amices / mice

Multivariate Imputation by Chained Equations
https://amices.org/mice/
GNU General Public License v2.0
433 stars 107 forks source link

Returning AMEs from mice estimates #493

Closed gabevar closed 1 year ago

gabevar commented 2 years ago

I posted this question to stackoverflow, which contains a reproducible example.

If this conversation isn't appropriate to Github issues, please let me know. I thought it would be interesting to open a conversation about the best way to approach retrieving average marginal effects in conjunction with the mice() logic.

My first intuition is to return AMEs before pooling...

m1 <- with(imputed_df, margins(lm(y ~ x1 * x2)))

...since a "margins" object works with tidy(), which pool() requires. However, it seems like pool() is missing some information from margins objects.

pool(m1) Warning in get.dfcom(object, dfcom) : Infinite sample size assumed.

The other is to return the average marginal effects of estimates after they are pooled and stored in a mipo object. This seems though since functions like margins() don't expect a mice() object.

What are your thoughts on this issue?

hanneoberman commented 1 year ago

Resolved on stackoverflow