Questions tagged [r-mice]

Multiple imputation using Fully Conditional Specification (FCS) implemented by the MICE algorithm. Each variable has its own imputation model. Built-in imputation models are provided for continuous data (predictive mean matching, normal), binary data (logistic regression), unordered categorical data (polytomous logistic regression) and ordered categorical data (proportional odds).

mice is an package for R, written by Stef van Buuren. The mice package implements a method to deal with [tag: missing data].

Repositories

Vignettes (Overview)

Further reading

Other resources

Related packages

Related tags

551 questions
3
votes
1 answer

R - mice - adding a column that sums columns with imputed values

I have a database with missing data. I need to impute data (I am using mice), then create new columns based on the original columns (using the imputed data). It is these new columns that I need to do my statistical analyses with. Specifically, my…
Zephyr
  • 51
  • 6
3
votes
0 answers

Pooling sandwich variance estimator over multiply imputed datasets

I am running a poisson regression on multiply imputed data to predict a common binary outcome. After running mice, I have obtained a stacked data frame comprising the raw data and five imputed datasets. Here is a toy example: df <- mice::nhanes imp…
C_H
  • 191
  • 14
3
votes
0 answers

Calculating AUC for a glm model on data imputed using the MICE package

On a regular dataset, the calls will go like this: library(ROCR) mymodelFit1 <- glm(data = myData, Outcome~ predictor1+ predictor2+ predictor3, family = binomial(link = "logit"))) prob <- predict(mymodelFit1, newdata=myData,…
Wael Hussein
  • 135
  • 1
  • 12
3
votes
1 answer

Model multiple imputation with interaction terms

According to the documentation of the mice package, if we want to impute data when we're interested in interaction terms we need to use passive imputation. Which is done the following way. library(mice) nhanes2.ext <- cbind(nhanes2, bmi.chl =…
user3631369
  • 329
  • 1
  • 12
3
votes
2 answers

Residual plots for multiple imputation using mice package in R

With the mice package, how do we check for the residuals of the pooled analysis? library(mice) imp <- mice(nhanes, seed = 23109) fit <- with(imp, lm(chl ~ age + bmi)) pool(fit) summary(pool(fit)) fit contains the analysis for each imputed dataset…
user3631369
  • 329
  • 1
  • 12
3
votes
3 answers

Displaying of factor levels and labels in R

I am having an issue with displaying the correct grouping of a factor variable after using MICE. I believe this is an R thing, but I included it with mice just to be sure. So, I run my mice algorithm, here is a snipit of how I call I format it in…
RayVelcoro
  • 524
  • 6
  • 21
3
votes
0 answers

Custom predictor matrix for multiple imputation with mice in R does not work

I am trying to impose a predictor matrix of my own to the mice command of the mice package in R, to control which variables are imputed and based on which variables they are imputed. However, the command does not work. I have 33 variables and I…
torwart
  • 550
  • 1
  • 5
  • 11
3
votes
1 answer

Automatically compare nested models from mice's glm.mids

I have a multiply-imputed model from R's mice package in which there are lots of factor variables. For example: library(mice) library(Hmisc) # turn all the variables into factors fake = nhanes fake$age = as.factor(nhanes$age) fake$bmi =…
half-pass
  • 1,851
  • 4
  • 22
  • 33
3
votes
1 answer

R mice package: error in 2l.norm when there is only 1 NA

After specifying the "2l.norm" method when calling mice i stumbled upon an error message for variables containing only 1 NA. I realize this is a very minor problem considering the very minor amount of missing data for these variables. However, it…
Jeroen Hoogland
  • 133
  • 1
  • 9
3
votes
1 answer

Has anyone tried to parallelize multiple imputation in 'mice' package?

I'm aware of the fact that Amelia R package provides some support for parallel multiple imputation (MI). However, preliminary analysis of my study's data revealed that the data is not multivariate normal, so, unfortunately, I can't use Amelia.…
Aleksandr Blekh
  • 2,462
  • 4
  • 32
  • 64
3
votes
2 answers

Combining ROC estimates from multiple imputation data

I have used the following R packages: mice, mitools, and pROC. Basic design: 3 predictor measures with missing data rates between 5% and 70% on n~1,000. 1 binary target outcome variable. Analytic Goal: Determine the AUROC of each of the 3…
user3228372
  • 41
  • 1
  • 4
2
votes
2 answers

How to Test Missing At Random (MAR) in R

How do I test the assumption Missing At Random (MAR) in R? Below are example data with code for testing completely missing at random (CMAR), and as well as imputation of missing data (which however assume MAR). # Example Questionnaire…
John
  • 309
  • 3
  • 12
2
votes
1 answer

Plotting a SEM Actor-Partner Interdependence Model after runMI()

I am using multiply-imputed data to run an Actor-Partner Interdependence Model (APIM; Cook & Kenny, 2005). I am using mice to impute my data and for reference, I am using this resource guide for constructing my APIM with lavaan. As far as I can…
jrcalabrese
  • 2,184
  • 3
  • 10
  • 30
2
votes
1 answer

Clustered standard errors with imputed and weighted data in R

I am attempting to get clustered SEs (at the school level in my data) with data that is both imputed (MICE) and weighted (CBPS). I have tried a couple different approaches that have thrown different errors. This is what I have to start, which works…
g_t_b
  • 143
  • 9
2
votes
0 answers

r-mice: pass argument to glm.fit in mice call

I ran into the same issue presented in mice: glm.fit: algorithm did not converge and originally adopted the solution that the question asker did (and it worked ok). My imputation procedure takes a longer time than is acceptable to me, though, so…