Closed liaoqijia closed 3 weeks ago
You might be able to include the weights in a lmer()
model, but you can't calculate correct standard errors. The standard errors that come from the model are completely invalid. In most cases, though, you don't need to use a mixed model to estimate treatment effects after weighting. If your goal is to estimate a treatment effect, you can just compute a weighted difference in means (e.g., using lm_weightit()
) and use a cluster-robust SE if your units are nested in clusters. If this is for a longitudinal analysis, you can try using GEE. But there are very few cases where a mixed model is required. If you want correct SEs from a mixed model, you can try doing a cluster bootstrap.
Hi, thanks for developing the R package. I have a question of whether I can fit the outcome regression with
lmer()
by using the weight obtained from the following code:W <- weightit(Ac ~ X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9, data = d, moments = 2, int = TRUE, method = "ebal")
W
Best, Qijia