CamDavidsonPilon / lifelines

Survival analysis in Python
lifelines.readthedocs.org
MIT License
2.36k stars 559 forks source link

marginal structural models #487

Open CamDavidsonPilon opened 6 years ago

CamDavidsonPilon commented 6 years ago

http://ageconsearch.umn.edu/bitstream/116267/2/sjart_st0075.pdf https://www.youtube.com/watch?v=MIBmdqE0tAM https://epiresearch.org/wp-content/uploads/2014/07/Robins_EPI_2000_11_550.pdf https://pdfs.semanticscholar.org/2398/b3f6dbaabc6f9c2882984ada59eb8d268312.pdf https://cdn1.sph.harvard.edu/wp-content/uploads/sites/1268/2018/02/hernanrobins_v2.17.18.pdf

CamDavidsonPilon commented 6 years ago

Need time-varying weights in CoxTimeVaryingFitter

pzivich commented 6 years ago

+1 this would be great to have. I have code that calculates inverse probability weights for treatment, censoring, missingness, etc. via statsmodels. I have no way to fit time varying hazards model though.

I have some data sets from a class that we fit MSM. Once you have weights in the time varying Cox model, I can compare with SAS 9.4

pzivich commented 6 years ago

I wrote up an example marginal structural model using KaplanMeierFitter with IPTW and IPCW. It is an example of using the functions I have to generate IP weights. Once time-varying Cox Model has weights implemented, I can rerun the code and add the example

http://zepid.readthedocs.io/en/latest/Inverse%20Probability%20Weights.html#time-varying

CamDavidsonPilon commented 6 years ago

Awesome library, @pzivich! I had no idea you worked on that :)

pzivich commented 6 years ago

Another MSM paper https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2732954/