As described in Young et al. (2010), this function simulates data that follows three causal models: Structural Nested Accelerated Failure Time Model, Marginal Structural Cox Model, and Structural Nested Cumulative Failure Time Model
This provides an R based analog to the SAS macro on the Harvard Program on Causal Inference's software page: https://cdn1.sph.harvard.edu/wp-content/uploads/sites/148/2012/10/simulate_snaftm.txt