Closed Generalized closed 1 year ago
Hi,
Unfortunately, I don’t have time to figure out this complicated situation and give support.
But the warning doesn’t come from marginaleffects
package itself. Maybe it comes from mice? You may want to set options()
to trigger errors instead of warnings, and then use traceback()
to track down the problem.
Dear @vincentarelbundock Now I come with another problem. Let me briefly explain what I do:
1) I perform multiple imputation over a dataset with several columns, which are used to derive a new outcome called "overall success" (it's a clinical study), which will be compared across 2 treatment arms.
2) the derivation (creation) if this new variable is done after the imputation, based on the complete data. Because the "post-processing" syntax of mice was too difficult to me, I did it explicitly after the imputation, iterating through the list of imputed datasets and doing some dplyr mutate()
3) having the new variable created, I perform the logistic regression followed by AME to obtain the difference between two treatment arms. Then I pool the results. Done.
So far I did it this way. I'm sorry for "pseudo code", but the data itself is to big to bring it here... But I provide all steps and results.
OK! Now let's check with a dedicated function from the miceafter package (Wald's difference in 2 proportions with non-pooled SEs)
Just some sanity check...
The agreement is fine.
Then I realized I can do it a bit simpler:
Now the lower CI is: -0.05120674 vs -0.05154214
I noted the message: Infinite sample size assumed. OK, so the normal approximation was used. But the Df confused me. It's 1233 rather than Inf.
OK, let's try providing the DF manually:
But nothing happened, the message remains and the results don't change.
I'm wondering if it's possible to obtain the same results regardless of the approach: pooling the AMEs over the GLM explicitly vs. running AME over the mira with imputed GLMs.
I use the developer's version: ‘0.13.0.9009’