Skip to content
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

Color for exclusion-restriction variable in plot_pred() is coded wrong #125

Closed
hanneoberman opened this issue Oct 4, 2023 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@hanneoberman
Copy link
Member

pred <- mice::quickpred(mice::nhanes)
pred[,1] <- -3
ggmice::plot_pred(pred)

Created on 2023-10-04 with reprex v2.0.2

@hanneoberman hanneoberman added the bug Something isn't working label Oct 4, 2023
@stefvanbuuren
Copy link
Member

Hmm, interesting. Does 1 stand for "incomplete predictor" and -3 for "complete predictor"?

@hanneoberman
Copy link
Member Author

There is currently no difference between complete and incomplete predictors. I have taken this from the vignette:

"In the predictor matrix, -2 denotes the class variable, a value 1 indicates a fixed effect and a value 2 indicates a random effect"

Instead of this from the mitml package reference:

"1: target variables containing missing data
2: predictors with fixed effect on all targets (completely observed)
3: predictors with random effect on all targets (completely observed)
-1: grouping variable within which the imputation is run separately
-2: cluster indicator variable
0: variables not featured in the model"

The value -3 would denote a new imputation model predictor type, implemented in the Heckman method in micemd.

@hanneoberman
Copy link
Member Author

pred <- mice::quickpred(mice::nhanes)
pred[,1] <- -3
ggmice::plot_pred(pred)

Created on 2023-10-04 with reprex v2.0.2

@stefvanbuuren
Copy link
Member

Thanks. I wasn't aware of the -3 code. Perhaps we should start a code registry?

@hanneoberman
Copy link
Member Author

Good idea! Maybe the Wiki feature on Github or a reference page on amices.org would be nice.

@stefvanbuuren
Copy link
Member

I made a previous inventory. Perhaps we could that into a table of code by method

  • Univariate imputation methods for two-level data use other codes than 0 and 1
  • 2l.bin, 2l.lmer, 2l.norm, 2l.pan, 2lonly.mean, 2lonly.norm and 2lonly.pmm use code -2 to indicate the class variable
  • 2l.bin, 2l.lmer, 2l.norm and 2l.pan use code 2 to indicate the random effects
  • 2l.pan uses codes 3 and 4 to add class means to codes 1 and 2 respectively

hanneoberman added a commit that referenced this issue Dec 21, 2023
Just some documentation and a small bugfix (colors in `plot_pred()` #125)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants