Maintainer: Ehsan Karim
I am a big fan of scientific collaboration. Feel free to contact me to discuss your causal inference related projects for potential collaboration.
R package to generate data suitable for Marginal Structural Cox Model fit
- This package simulates survival data suitable for fitting Marginal Structural Model.
Loading the package
Pulling the help file
Setting working directory to save the generated datafiles
setwd("C:/data") # change working dir
Using this package to generate data in the working directory
simmsm(subjects = 2500, tpoints = 10, psi = 0.3, n = 1000) # This code generates 1000 datasets (takes time!) # 2500 subjects in each datasets # Each subject followed upto 10 time-points (say, months) # Causal effect (log-odds) is 0.3
|subjects||Number of Subjects in each simulated dataset|
|tpoints||Maximum number of time-points each subjects are followed|
|psi||Causal effect parameter for Marginal Structural Model|
|n||Number of simulated datasets an user wants to generate|
- Ehsan Karim (only R porting from the SAS code). I wrote them in R basically to understand the mechanism, but the SAS / SAS IML / Stata codes (I have them as well, available upon request) are faster than this. Feel free to report any errors / update suggestions.
- Young J.G., Hernan M.A., Picciotto S., and Robins J.M. Relation between three classes of structural models for the effect of a time-varying exposure on survival. Lifetime Data Analysis, 16(1):71-84, 2010.
- Young, Jessica G., et al. Simulation from structural survival models under complex time-varying data structures. JSM proceedings, section on statistics in epidemiology. American Statistical Association, Denver, CO (2008)
- Ali R.A., Ali M.A., and Wei Z. On computing standard errors for marginal structural cox models. Lifetime data analysis, pages 1–26, 2013. doi: 10.1007/s10985-013-9255-7.
- Xiao Y., Abrahamowicz M., and Moodie E.E.M. Accuracy of conventional and marginal structural Cox model estimators: A simulation study. The International Journal of Biostatistics, 6(2):1–28, 2010.
- Karim, M. E.; Petkau, J.; Gustafson, P.; Platt, R.; Tremlett, H. and BeAMS study group. Comparison of Statistical Approaches Dealing with Time-dependent Confounding in Drug Eﬀectiveness Studies. Statistical Methods in Medical Research. First published online: September 21. doi: 10.1177/0962280216668554
- Karim, M. E.; Petkau, J.; Gustafson, P.; Tremlett, H. and BeAMS study group. On the application of statistical learning approaches to construct inverse probability weights in marginal structural Cox models: hedging against weight-model misspeciﬁcation. Communications in Statistics - Simulation and Computation (In Press).