Closed pzivich closed 6 years ago
Tentative plan:
Include optional argument weights
in zepid.causal.gformula.TimeFixedGFormula
and zepid.causal.gformula.TimeVaryGFormula
Use statsmodels
GEE
to estimate each model. This is because GLM
uses integer based weights. GEE
allows the more dynamic weights. It would allow for both integer and non-integer weights. The disadvantage is that GEE
takes a little longer to fit. Overall, should not slow down the MC simulation procedure too much
Completed for TimeFixedGFormula
. Will be part of v0.3.2 release
I need to think a little more about TimeVaryGFormula
and what should be done about weights that vary over time (in regards to the MC process)
TimeVaryGFormula
uses the initial weights. IPCW should probably be avoided anyways since you can directly model censoring into the g-formula (I believe this is the recommendation).
All that is left is to test to make sure it works as intended
Check was just seeing if usage of weights statement throws any errors. It didn't. I don't have a data set to check the results against yet though. That is for future.
Will be released as part of v0.3.2
Need to add option for weights in g-formula. Would allow for sampling weights or other options (IPCW / IPMW)