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
20
votes
2 answers

Parallel computation of multiple imputations by using mice

I want to run 150 multiple imputations by using mice in R. However, in order to save some computing time, I would like to subdivide the process in parallel streams (as suggested by Stef van Buuren in "Flexible Imputation for Missing Data"). My…
13
votes
1 answer

predict() method for "mice" package

I want to create imputation strategy using mice function from mice package. The problem is I can't seems to find any predict methods (or it's cousins) for new data in this package. I want to do something like…
Loiisso
  • 161
  • 1
  • 6
12
votes
2 answers

Random Effects in Longitudinal Multilevel Imputation Models Using MICE

I am trying to impute data in dataset with a longitudinal design. There are two predictors (experimental group, and time) and one outcome variable (score). The clustering variable is id. Here is the toy data set.seed(345) A0 <- rnorm(4,2,.5) B0 <-…
llewmills
  • 2,959
  • 3
  • 31
  • 58
12
votes
4 answers

Perform operation on each imputed dataset in R's MICE

How can I perform an operation (like subsetting or adding a calculated column) on each imputed dataset in an object of class mids from R's package mice? I would like the result to still be a mids object. Edit: Example library(mice) data(nhanes) #…
half-pass
  • 1,851
  • 4
  • 22
  • 33
10
votes
4 answers

Imputation MICE in R still NA left in dataset

After running MICE package, the number of missing values are shrinked from 147428 to 46093 in each of the 5 complete imputation sets. But isn't it supposed to be 0 NAs instead??? Thanks! Here is my MICE code: imp = mice(newdata) imputationSet1 =…
Yue Harriet Huang
  • 3,969
  • 6
  • 17
  • 16
9
votes
0 answers

Large sparse matrix to matrix error

I want to apply mice package, but I cannot convert large sparse matrix to…
chiao-ling Chen
  • 131
  • 1
  • 4
9
votes
1 answer

Predicting responses for new observations using a model developed with multiple imputation via MICE

I have developed a model via multiple imputation using mice. I want to use this model to predict responses for new observations (containing no missing data), including standard errors. Passing the model object created in mice to predict doesn't…
wjchulme
  • 1,928
  • 1
  • 18
  • 28
9
votes
3 answers

Error in R (mice package), too many weights

I get the following error while imputing missing cases with the mice function from the library "mice" Error in nnet.default(X, Y, w, mask = mask, size = 0, skip = TRUE, softmax = TRUE, : too many (1104) weights The problem is generated by the…
8
votes
1 answer

Using imputed datasets from library mice() to fit a multi-level model in R

I'm new to package mice in R. But I'm trying to impute 5 datasets from popmis and then fit an lmer() model with() each and finally pool() across them. I think the pool() function in mice() doesn't work with the lmer() call from lme4 package,…
rnorouzian
  • 7,397
  • 5
  • 27
  • 72
8
votes
1 answer

Do imputation in R when mice returns error that "system is computationally singular"

I am trying to do imputation to a medium size dataframe (~100,000 rows) where 5 columns out of 30 have NAs (a large proportion, around 60%). I tried mice with the following code: library(mice) data_3 = complete(mice(data_2)) After the first…
user8270077
  • 4,621
  • 17
  • 75
  • 140
8
votes
3 answers

Error when using mice object: No applicable method for 'complete_'

library(mice) md.pattern(dat1) temp<-mice(dat1, m = 5, seed = 101) dat1 <- complete(temp, 2) Error in UseMethod("complete_") : no applicable method for 'complete_' applied to an object of class "mids" Hi, I'm trying to impute missing values using…
Jonggi Choi
  • 81
  • 1
  • 3
8
votes
4 answers

R - mice - machine learning: re-use imputation scheme from train to test set

I'm building a predictive model and am using the mice package for imputing NAs in my training set. Since I need to re-use the same imputation scheme for my test set, how can I re-apply it to my test data? # generate example data set.seed(333) mydata…
Timm S.
  • 5,135
  • 6
  • 24
  • 38
8
votes
3 answers

Multiple Imputation of longitudinal data in MICE and statistical analyses of object type mids

I have a problem with performing statistical analyses of longitudinal data after the imputation of missing values using mice. After the imputation of missings in the wide data-format I convert the extracted data to the longformat. Because of the…
7
votes
1 answer

MICE does not impute certain columns, but also does not give an error

I know that similar questions have been asked before (e.g., 1, 2, 3), but I still do not understand the reason why mice is failing to predict missing values even when I try unconditioned mean like in the example 1. The sparse matrix I have is: …
user3575876
  • 325
  • 1
  • 3
  • 10
7
votes
1 answer

Pooling Cox PH results after multiple imputation with the MICE package

I have a dataset with survival data and a few missing covariates. I've successfully applied the mice-package to imputate m-numbers of datasets using the mice() function, created an imputationList object and applied a Cox PH model on each m-dataset.…
Kjetil Loland
  • 83
  • 1
  • 4
1
2 3
36 37