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).
The first application on missing blood pressure data (Buuren, Boshuizen, and Knook 1999).
Term Fully Conditional Specification describes a general class of methods that specify imputations model for multivariate data as a set of conditional distributions (Buuren et al. 2006).
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…
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…
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,…
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 =…
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…
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…
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…
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 =…
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…
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.…
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…
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…
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…
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…
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…