migariane / TutorialComputationalCausalInferenceEstimators

Tutorial_Computational_Causal_Inference_Estimators
MIT License
29 stars 16 forks source link

Marginal structural model in R code for box 20 #4

Open annlia opened 1 year ago

annlia commented 1 year ago

The marginal structural model used with non-stabilised weights appears to include covariates msm <- lm(Y ~ A + C + w1 + w2 + as.factor(w3) + as.factor(w4), data = data, weights = data$w) # MSM

Is there a reason for that? I would have expected it to look exactly like the MSM with stabilised weights (just with different weights) msm <- lm(Y ~ A, data = data, weights = sw)

The corresponding Stata code in the paper does not appear to include any covariates in either case.