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
0
votes
1 answer

In R, how to derive an average percentage statistics on a column from multiple dataframes?

A while back I conducted multiple imputations with mice() 20 times, and saved these using the following: for (i in 1:20) { write.csv(complete(imp20, i), file=paste("imp", i, ".csv", sep="")) } Now I would like to derive an average n and % for a…
0
votes
0 answers

Error message re: MICE procedure in R to impute missing data

I am trying to use the mice procedure in R to impute missing data. My database is 800k rows I get this message when I enter this code: Call the mice package: library(mice) Warning message: package ‘mice’ was built under R version 3.2.5 …
WillCoop4
  • 15
  • 6
0
votes
2 answers

Looping columns and row in R

I'm having difficulty creating a loop to identify missing values in a column. I'm using this loop to add columns into a smaller dataset, impute with mice, then merge back. I can't write manually within my function because the output data will be a…
ASavage
  • 33
  • 1
  • 8
0
votes
0 answers

Posterior Predictive Checking

I'm relatively new at all this. I've performed an imputation on metabolomics data, and another colleague has queried the quality of my imputation (I performed predictive mean matching using MICE in R.) Having looked into this, there isn't any…
0
votes
0 answers

Having trouble getting a complete dataset from a mids object using MICE in R

I simulated a dataset with missing not at random. And then I used mice()to impute it, but R does not return a complete dataset for me. My code looks like: tempData <- mice(data1) completedData <- complete(tempData) data1 is the dataset with…
Joye Qiao
  • 1
  • 1
0
votes
1 answer

How to set MaxNWts value in R

I am trying to impute categorical data through the mice package. {qualiD = mice(quali,1, seed=123)} And I get the following error: {Error in nnet.default(X, Y, w, mask = mask, size = 0, skip = TRUE, softmax = TRUE, : too many (2184)…
Uswer721
  • 565
  • 1
  • 7
  • 13
0
votes
2 answers

How to choose best imputed data using mice

Using mice package I imputed a dataset like: imp <- mice(nhanes) It generates 5 imputed datasets for each variables: imp$imp$bmi # 1 2 3 4 5 #1 35.3 30.1 26.3 28.7 27.2 #3 30.1 22.0 30.1 28.7 22.0 #4 21.7 27.2 25.5 24.9 21.7 #6 …
0
votes
0 answers

as.mids in r package mice yields "Error in `row.names<-.data.frame`(`*tmp*`, value = value) : invalid 'row.names' length"

R kept crashing when I attempted to use mice with my dataset so I did my mi in SPSS v. 24. I then imported the multiply imputed data into R as Imp5N2NPV4_2_17. I want to convert that dataframe into mids to proceed with my analyses, but am getting an…
Ellesmere
  • 1
  • 2
0
votes
0 answers

Can I use quickpred in Mice to impute a subset of variables from a larger set of variables in a nested longitudinal (and long) dataframe?

I've tried to create a test data.frame to demonstrate my question but my r capacity isn't quite strong enough to even do that. I am not in a position to share my true database. I hope my question can stand on its own. I am working with a nested…
Ellesmere
  • 1
  • 2
0
votes
1 answer

How to specify which rows to be imputed with MICE?

How can I run Multivariate Imputation by Chained Equations with mice() for this dataset, using rows 1:10, but predicting only for row #11? library(mice) library(car) df = mtcars[c(1:10), c(3:5)] df[c(1:3), c(1)] = NA df[c(4:7), c(2)] =…
sandoronodi
  • 315
  • 2
  • 12
0
votes
0 answers

lattice plot functions do not work with mids (mice output)

I have a dataset with missing values and therefore run the mice function as a imputation method. Until here everything worked fine. Now I want to compare the distribution of original and imputed dataset with the lattice package using xyplot,…
nississippi
  • 327
  • 2
  • 17
0
votes
0 answers

Pool.Scalar function of mice package returning NA's

I imputed a data using the mice package in R. The dataset contains a factor variable with n levels of factor. I would like to calculate the proportion of each factor and return the standard errors accounting the imputed values. Below is a sample…
dixi
  • 680
  • 1
  • 13
  • 27
0
votes
2 answers

Imputing values : VIM package (aggr function) - dims [product 284088] do not match the length of object [284121]

I am having problem while plotting missing/imputed values. When I try to run this code: (demo is the name of the dataset) mice_plot <- aggr(demo, col=c('navyblue','yellow'), numbers=TRUE, sortVars=TRUE, …
Harshit Singh
  • 625
  • 5
  • 17
0
votes
0 answers

Error in MICE package in R

I am getting the error when i run the below code for imputing the missing values through MICE package in R url <- "https://raw.githubusercontent.com/selva86/datasets/master/Cars93_miss.csv" ca <- read.csv(url) im_ca <- mice(ca, MaxNWts = 4000) iter…
Mohan Raj
  • 77
  • 1
  • 2
  • 9
0
votes
2 answers

averaging imputation of missing values

I got a few questions, I couldn't really find anything on with the documentation unless I'm missing something or don't understand imputation process/logic. Basically the most important is that since sometimes the 'imputed' values are different, I'd…
runningbirds
  • 6,235
  • 13
  • 55
  • 94