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
0 answers

Operating on the lists in a list, storing the result in the global environment

I am using mice library(mice) to impute a large amount of databases. I have written a code which makes imputations for all dataframes in my global environment. The result of this exercise is a large list of lists called dfmice. For each list within…
Tom
  • 2,173
  • 1
  • 17
  • 44
0
votes
1 answer

Automatic subsetting of a dataframe on the basis of a prediction matrix

I have created a prediction matrix for large dataset as follows: library(mice) dfpredm <- quickpred(df, mincor=.3) A B C D E F G H I J A 0 1 1 1 0 1 0 1 1 0 B 1 0 0 0 1 0 1 0 0 1 C 0 …
Tom
  • 2,173
  • 1
  • 17
  • 44
0
votes
0 answers

Using a loop to impute dataframes with mice, using prediction matrices from a list

I have a global environment with many dataframes which should be imputed with mice library(mice). In order to first calculate the prediction matrices I did (with the help of some other people) the following: library(mice) PredMatr=…
Tom
  • 2,173
  • 1
  • 17
  • 44
0
votes
3 answers

function not found although package is loaded - R

I have been working with an imputed data set using the MICE package (versions 2.2-3.3) in R (versions 3.3-3.5). I am now trying to add some variables to the imputed data set, which historically have worked fine using cbind.mids() (in this specific…
Wernicke
  • 15
  • 4
0
votes
1 answer

Imputation model for time series missing data in R

Time series data consists of: Product (categorical); ProductGroup (categorical); Country (categorical); YearSinceProductLaunch (numeric); SalesAtLaunchYear (numeric) Only "SalesAtLaunchYear" data has some missing values which needs to be…
aza07
  • 239
  • 1
  • 6
  • 14
0
votes
0 answers

Memory usage of imputation with mice in R

I am currently working on the imputation of 10 large datasets (by first creating a prediction matrix with correlation of 0.3, dfpred03) with mice in R and I am having a lot of issues like the following: imptest <- mice(df, m=1, maxit = 1,…
Tom
  • 2,173
  • 1
  • 17
  • 44
0
votes
3 answers

Combine imputed and non imputed data

I have a question about merging datasets after multiple imputation. I have created an example to explain my problem: id <- c(1,2,3,4,5,6,7,8,9,10) age <- c(60,NA,90,55,60,61,77,67,88,90) bmi <- c(30,NA,NA,23,24,NA,27,23,26,21) time <-…
Anna_70
  • 91
  • 1
  • 7
0
votes
0 answers

Using a for loop in combination with a formula (mice) to create multiple objects (outcomes) of the formula

I am using mice to impute my data. It has a neat feature which creates a prediction matrix for your dataframe based on the correlation between variables. LINK Because I have multiple datasets that need imputing and it takes quite a long time, I want…
Tom
  • 2,173
  • 1
  • 17
  • 44
0
votes
1 answer

Can't import 'mice' package in R on MacOS Mojave

Can install 'mice' package in R but I can't import it. Same error keeps occurring after reinstallation of R and mice package. R version : 3.5.1 Error: package or namespace load failed for ‘mice’ in readRDS(mapfile): unknown input format
Htut Lin Aung
  • 31
  • 1
  • 6
0
votes
1 answer

'mice' R package isn't imputing data

I've run a regression to replace missing data in a dataset and want to compare it to the results of using the 'mice' package by Stef va Buuren I'm referencing this link here on cross-validated Link to Post I'm also reading This which is similar…
wayneeusa
  • 194
  • 1
  • 10
0
votes
2 answers

Descriptive statistics per subgroup after imputation using MICE

I want to generate descriptive statistics for different subgroups after multiple imputation with MICE. I have a dataset that include a medicine and age, which I imputed. id <- c(1,2,3,4,5,6,7,8,9,10) age <- c(60, 80, 70, NA, 49, 30, NA, 59, 79,…
user10530556
0
votes
2 answers

Replace all NAs with -1 in r with dplyr

I'm currently working with the tidyverse in R. After using mice to impute NAs some of the columns still have NAs due to the fact that they are poorly populated to begin with (I believe). As a final check I want to replace all of the remaining NAs…
0
votes
0 answers

Regression analysis on MICE R

I recently updated the MICE package and some code I had before broke... I don't use MICE very much so would be extremely grateful for suggestions on a fix imputed_scabies_model <-…
mmarks
  • 1,119
  • 7
  • 14
0
votes
1 answer

Role of raw data in pooled estimates from mice (R package)?

I'm wondering what is the role of the original data set when using the mice package in R for imputed data. I need to impute my data and then compute some additional variables before turning the long data set back into an as.mids object. I noticed…
user2917781
  • 273
  • 2
  • 10
0
votes
1 answer

Can MICE pool results of ordinal logistic regression run by the function polr()?

I'm running the data set downloaded from UCLA read.dta("https://stats.idre.ucla.edu/stat/data/ologit.dta") and randomly assign some missing values in the independent variables: pared, public, and gpa. Then I use mice to generate imputed values and…
d.lee
  • 3
  • 4