Different results within mice compared to directly using method functions #663
Replies: 2 comments
-
The difference comes from the pre-processing done by the # Set seed
set.seed(20240731)
# Generate data using your dgp function
data <- dgp()
# Run mice
mice_m <- mice(
data = data$amp,
m = 2, maxit = 2,
method = "lasso.select.norm",
ls.meth = "ridge",
printFlag = FALSE
)
# Check logged events
mice_m$loggedEvents In the logged events, you should see that many variables have been "kicked out," meaning they never made it to the eval(parse(
text = paste0(
"mice_m <- ", method_fact$wrapper[i],
"(data = data$amp, m = m, maxit = maxit, method = '",
method_fact$method[i],
"',ls.meth = 'ridge', printFlag = FALSE, eps = 0)"
)
)) I ran your code with this change, and the resulting plot is the following: There are no more differences between your wrapper and the standard I think I should clarify that Let me know if this solves your issue entirely or if there is anything else I can help with. |
Beta Was this translation helpful? Give feedback.
-
@EdoardoCostantini thanks. No really a bug or problem. I will convert the issue to a Discussion. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
I wanted to conduct a simulation study with one missing variable using
mice.impute.lasso.select.norm
. However, this method consistently failed to select the correct variables when used within themice
, despite working correctly when used directly. To address this issue, I created my own simplified wrapper function (called itshort_mice
), which should be sufficient for this situation. I then compared its performance to themice
wrapper through a short simulation using several methods (not justlasso.select.norm
) and observed quite different results.To Reproduce
Nsim = 10 and m = 5 should be increased!
Created on 2024-05-28 with reprex v2.1.0
Session info
Expected behavior
I would expect the outputs to be more similar.
Thank you very much for any clarification!
Beta Was this translation helpful? Give feedback.
All reactions