I would like to apply the margins function to imputed data (I used mice), but it seems not possible. Do you know if a function exists that calculates marginal effects with imputed data?
Thank you!
Edit: I have modified my code as follows: is it correct? Thank you!
ddply(data_pooled, "imp", function(x){
logregress <- glm(y ~ var1 + var2 + var3, family = binomial(link="logit"), data=data_pooled)
margin_mod <- margins(logregress, type="response")
})
margin_summary <- summary(MIcombine(margin_mod))