Closed pzivich closed 5 years ago
Unfortunately, this will be slightly more complicated than I would like. For the all the generalizability/transportability tools for observational data, it takes input of the weights. This aligns with the current API of v0.7.0
I still think estimating marginal structural models for the user is the way forward. To solve this issue, the user could extract the weights from the updated IPTW
then supply them to the generalizability tools. I will need to think about this some more...
Closed via #108
Lately I have been considering changing the
IPTW
procedure to more closely adhere to the other estimators. Specifically,IPTW
only calculates the weights for the user. It then passes them to the user and assumes they know how to apply them afterwards. I made this decision a long time ago, but am reconsidering.The API change would be something like the following;
IPTW
gains themarginal_structural_model()
function, which allows for specification of the MSM. This would allow users to specify MSM for continuous variables and for interactionsregression_models()
becomesexposure_model()
to better align with the other APIfit()
no longer calculates the weights. The weights calculation moves toexposure_model()
behind the scenes. Everything still gains theWeight
attribute, so users can directly access this and the predicted probabilitiesAll assumption checks, like Love plots, would become available after
exposure_model()
is called.Since I would be taking the burden of fitting the MSM, I would need to add different IPTW classes, like
SurvivalIPTW
for baseline-treatment weighting,LongitudinalIPTW
for longitudinal data, andTimeVaryIPTW
for time-varying variables.Additionally, there would need to be the
weight
attributed added to allow addition of IPMW or IPCW for estimation procedures.