-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove.lindep() can lead to inconsistent predictorMatrix printing in the mids object #306
Comments
Thanks for pointing out this problem. As far as I can see, there is a unwanted interaction between the regularisation techniques you've implemented in I once created So let's make a plan to retire I did an experiment by setting |
I'm not sure where this particular issue is on the roadmap, but I am working on some code to do high-dimensional mass imputation using a reimplementation of I realize my scenario might be an edge case, and I can hack around this with a fork or maybe replacing |
Yes, retiring
The implementation will need to be integrated well into various parts in Adding a remover is separate from upgrading |
I'll have to look at how the ranger option in
|
Did some experiments to bypass library(mice, warn.conflicts = FALSE)
imp <- mice(selfreport, m = 1, maxit = 1, print = FALSE)
#> Warning: Number of logged events: 7
imp$loggedEvents
#> it im dep meth out
#> 1 0 0 constant pop
#> 2 0 0 constant prg
#> 3 1 1 hm pmm srcmgg, etnUnknown, webYes
#> 4 1 1 wm pmm srcmgg, etnUnknown, webYes
#> 5 1 1 edu polyreg srcmgg, wr, etnUnknown
#> 6 1 1 etn polyreg srcmgg, wr
#> 7 1 1 bm pmm srcmgg, etnUnknown, webYes
imp <- mice(selfreport, m = 1, maxit = 1, print = FALSE, eps = 0)
#> Error in solve.default(xtx + diag(pen)): Lapack routine dgesv: system is exactly singular: U[13,13] = 0
imp <- mice(boys[boys$gen != "G5", ], m = 1, maxit = 1, print = FALSE)
#> Warning: Number of logged events: 8
imp$loggedEvents
#> it im dep meth out
#> 1 1 1 age pmm gen.L
#> 2 1 1 hgt pmm gen.L
#> 3 1 1 wgt pmm gen.L
#> 4 1 1 bmi pmm gen.L
#> 5 1 1 hc pmm gen.L
#> 6 1 1 phb polr gen.L
#> 7 1 1 tv pmm gen.L
#> 8 1 1 reg polyreg gen.L
imp <- mice(boys[boys$gen != "G5", ], m = 1, maxit = 1, print = FALSE, eps = 0)
#> Warning: Number of logged events: 6
imp$loggedEvents
#> it im dep meth
#> 1 1 1 age pmm
#> 2 1 1 hgt pmm
#> 3 1 1 wgt pmm
#> 4 1 1 bmi pmm
#> 5 1 1 hc pmm
#> 6 1 1 tv pmm
#> out
#> 1 mice detected that your data are (nearly) multi-collinear.\nIt applied a ridge penalty to continue calculations, but the results can be unstable.\nDoes your dataset contain duplicates, linear transformation, or factors with unique respondent names?
#> 2 mice detected that your data are (nearly) multi-collinear.\nIt applied a ridge penalty to continue calculations, but the results can be unstable.\nDoes your dataset contain duplicates, linear transformation, or factors with unique respondent names?
#> 3 mice detected that your data are (nearly) multi-collinear.\nIt applied a ridge penalty to continue calculations, but the results can be unstable.\nDoes your dataset contain duplicates, linear transformation, or factors with unique respondent names?
#> 4 mice detected that your data are (nearly) multi-collinear.\nIt applied a ridge penalty to continue calculations, but the results can be unstable.\nDoes your dataset contain duplicates, linear transformation, or factors with unique respondent names?
#> 5 mice detected that your data are (nearly) multi-collinear.\nIt applied a ridge penalty to continue calculations, but the results can be unstable.\nDoes your dataset contain duplicates, linear transformation, or factors with unique respondent names?
#> 6 mice detected that your data are (nearly) multi-collinear.\nIt applied a ridge penalty to continue calculations, but the results can be unstable.\nDoes your dataset contain duplicates, linear transformation, or factors with unique respondent names? Created on 2023-07-22 with reprex v2.0.2 In the Setting I tried to reproduce the problem in another example, the It is yet not quite clear 1) what is different from the |
There seems to be a reporting inconsistency when the
predictorMatrix
after imputation seems to indicate that a variable is included as a predictor, whileremove.lindep()
has effectively removed it. This leads to biased results due to an uncongenial imputation model, but may lull the user into thinking that the model is correctly specified. See below, whereimp1
is wrong andimp2
is correct, but they have the samepredictorMatrix
printed.Created on 2021-01-21 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: