Multiple imputation using Fully Conditional Specification (FCS)
implemented by the MICE algorithm as described in Van Buuren and
Groothuis-Oudshoorn (2011) . 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 can also impute
continuous two-level data (normal model, pan, second-level variables).
Passive imputation can be used to maintain consistency between variables.
Various diagnostic plots are available to inspect the quality of the
imputations.
The mice package implements a method to deal with missing data. The package creates multiple imputations (replacement values) for multivariate missing data. The method is based on Fully Conditional Specification, where each incomplete variable is imputed by a separate model. The MICE algorithm can impute mixes of continuous, binary, unordered categorical and ordered categorical data. In addition, MICE can impute continuous two-level data, and maintain consistency between imputations by means of passive imputation. Many diagnostic plots are implemented to inspect the quality of the imputations.
Installation
The mice package can be installed from CRAN as follows:
install.packages("mice")
The latest version is can be installed from GitHub as follows:
Add a hex sticker to the mice package. Designed by Jaden M. Walters.
Specify the R3.5.0 random generator in order to pass CRAN tests
mice 3.3.5
Remove test-fix.coef.R from tests
Adds a rotate.names argument to md.pattern() (#154, #160)
mice 3.3.4
Fix to solve the name-matching problem (#156, #149, #147)
mice 3.3.3
Fix that removes the pre-check for existence of mice.impute.xxx() so that mice::mice() works as expected (#55)
mice 3.3.2
Solves a bug that crashed mids2spss(), thanks Edgar Schoreit (#149)
mice 3.3.1
Solves a problem in the routing logic (#149) causing that passive
imputation was not done when no predictors were specified. No passive
imputation correctly will ignore any the specification of
predictorMatrix.
Implements an alternative solution for #93 and #96. Instead of skipping
imputation of variables without predictors, mice 3.3.1 will impute
those variables using the intercept only
Adds a routine contributed by Simon Grund that checks for deprecated
arguments #137
Improves the nelsonaalen() function for data where variables
time or status have already been defined (#140), thanks matthieu-faron
mice 3.3.0
Solves bug in passive imputation (#130). Warning: This bug may
have caused invalid imputations in mice 3.0.0 - mice 3.2.0 under
passive imputation.
Updates code to broom 0.5.0 (#128)
Solves problem with mice.impute.2l.norm() (#129)
Use explicit foreign function calls in tests
mice 3.2.0
Skip tests for mice.impute.2l.norm() (#129)
Skip tests for D1() (#128)
Solve problem with md.pattern (#126)
Evades warning in rbind and cbind (#114)
Solves rbind problem when method is a list (#113)
More efficient use of parlmice (#109)
Add dfcom argument to pool() (#105, #110)
Updates to parlmice + bugfix (#107)
mice 3.1.0
New parallel functionality: parlmice (#104)
Incorporate suggestion of @JoergMBeyer to flux (#102)
Replace duplicate code by estimice (#101)
Better checking for empty methods (#99)
Remove problem with parent.frame (#98)
Set empty method for complete data (#93)
Add NEWS.md, index.Rmd and online package documentation
Track .R instead of .r
Patch issue with updateLog (#8, @alexanderrobitzsch)
Extend README
Repair issue md.pattern (#90)
Repair check on m (#89)
mice 3.0.0
Version 3.0 represents a major update that implements the
following features:
blocks: The main algorithm iterates over blocks. A block is
simply a collection of variables. In the common MICE algorithm each
block was equivalent to one variable, which - of course - is
the default; The blocks argument allows mixing univariate
imputation method multivariate imputation methods. The blocks
feature bridges two seemingly disparate approaches, joint modeling
and fully conditional specification, into one framework;
where: The where argument is a logical matrix of the same size
of data that specifies which cells should be imputed. This opens
up some new analytic possibilities;
Multivariate tests: There are new functions D1(), D2(), D3()
and anova() that perform multivariate parameter tests on the
repeated analysis from on multiply-imputed data;
formulas: The old form argument has been redesign and is now
renamed to formulas. This provides an alternative way to specify
imputation models that exploits the full power of R's native
formula's.
Better integration with the tidyverse framework, especially
for packages dplyr, tibble and broom;
Improved numerical algorithms for low-level imputation function.
Better handling of duplicate variables.
ADDED: supports.transparent() to detect whether .Device can do semi-transparent colors
FIXED: stringr package is now properly loaded
ADDED: trellis version of plot.mids()
ADDED: automatic semi-transparancy detection in mdc()
FIXED: documentation of mira class (thanks Sandro Tsang)
mice 2.8 - 24-03-2011 / SvB
FIXED: bug fixed in find.collinear() that bombed when only one variable was left
mice 2.7 - 16-03-2011 / SvB
CHANGED: check.data(), remove.lindep(): fully missing variables are imputed if allow.na=TRUE (Alexander Robitzsch)
FIXED: bug in check.data(). Now checks collinearity in predictors only (Alexander Robitzsch)
CHANGED: abbreviations of arguments eliminated to evade linux warnings
mice 2.6 - 03-03-2011 / SvB
ADDED: bwplot(), stripplot(), densityplot() and xyplot() for creating Trellis graphs
ADDED: function mdc() and mice.theme() for graphical parameters
ADDED: argument passing from mice() to lower-level functions (requested by Juned Siddique)
FIXED: erroneous rgamma() replaced by rchisq() in .norm.draw, lowers variance a bit for small n
ADDED: with.mids() extended to handle expression objects
FIXED: reporting bug in summary.mipo()
CHANGED: df calculation in pool(), intervals may become slightly wider
ADDED: internal functions mice.df() and df.residual()
FIXED: error in rm calculation for "likelihood" in pool.compare()
CHANGED: default ridge parameter changed
mice 2.5 - 06-01-2011 / SvB
ADDED: various stability enhancements and code clean-up
ADDED: find.collinear() function
CHANGED: automatic removal of constant and collinear variables
ADDED: ridge parameter in .norm.draw() and .norm.fix()
ADDED: mice.impute.polr() for ordered factors
FIXED: chainMean and chainVar in mice.mids()
FIXED: iteration counter for mice.mids and sampler()
ADDED: component 'loggedEvents' to mids-object for logging actions
REMOVED: annoying warnings about removed predictors
ADDED: updateLog() function
CHANGED: smarter handling of model setup in mice()
CHANGED: .pmm.match() now draws from the three closest donors
ADDED: mids2spss() for shipping a mids-object to SPSS
FIXED: change in summary.mipo() to work with as.mira()
ADDED: function mice.impute.2L.norm.noint()
ADDED: function as.mira()
FIXED: global assign() removed from mice.impute.polyreg()
FIXED: improved handling of factors by complete()
FIXED: improved labeling of nhanes2 data
mice 2.4 - 17-10-2010 / SvB
ADDED: pool() now supports class 'polr' (Jean-Baptiste Pingault)
FIXED: solved problem in mice.impute.polyreg when one of the variables was named y or x
FIXED: remove.lindep: intercept prediction bug
ADDED: version() function
ADDED: cc(), cci() and ccn() convenience functions
mice 2.3 - 14-02-2010 / SvB
FIXED: check.method: logicals are now treated as binary variables (Emmanuel Charpentier)
FIXED: complete: the NULL imputation case is now properly handled
FIXED: mice.impute.pmm: now creates between imputation variability for univariate predictor
FIXED: remove.lindep: returns 'keep' vector instead of data
mice 2.2 - 13-01-2010 / SvB
ADDED: pool() now supports class 'multinom' (Jean-Baptiste Pingault)
FIXED: bug fixed in check.data for data consisting of two columns (Rogier Donders, Thomas Koepsell)
ADDED: new function remove.lindep() that removes predictors that are (almost) linearly dependent
FIXED: bug fixed in pool() that produced an (innocent) warning message (Qi Zheng)
mice 2.1 - 14-09-2009 / SvB
ADDED: pool() now also supports class 'mer'
CHANGED: nlme and lme4 are now only loaded if needed (by pool())
FIXED: bug fixed in mice.impute.polyreg() when there was one missing entry (Emmanuel Charpentier)
FIXED: bug fixed in plot.mids() when there was one missing entry (Emmanuel Charpentier)
CHANGED: NAMESPACE expanded to allow easy access to function code
FIXED: mice() can now find mice.impute.xxx() functions in the .GlobalEnv
mice 2.0 - 26-08-2009 / SvB, KO Major upgrade for JSS manuscript
ADDED: new functions cbind.mids(), rbind.mids(), ibind()
ADDED: new argument in mice(): 'post' in post-processing imputations
ADDED: new functions: pool.scaler(), pool.compare(), pool.r.squared()
ADDED: new data: boys, popmis, windspeed
FIXED: function summary.mipo all(object$df) command fixed
REMOVED: data.frame.to.matrix replaced by the internal data.matrix function
ADDED: new imputation method mice.impute.2l.norm() for multilevel data
CHANGED: pool now works for any class having a vcov() method
ADDED: with.mids() provides a general complete-data analysis
ADDED: type checking in mice() to ensure appropriate imputation methods
ADDED: warning added in mice() for constant predictors
ADDED: prevention of perfect prediction in mice.impute.logreg() and mice.impute.polyreg()
CHANGED: mice.impute.norm.improper() changed into mice.impute.norm.nob()
REMOVED: mice.impute.polyreg2() deleted
ADDED: new 'include' argument in complete()
ADDED: support for the empty imputation method in mice()
ADDED: new function md.pairs()
ADDED: support for intercept imputation
ADDED: new function quickpred()
FIXED: plot.mids() bug fix when number of variables > 5
mice 1.21 - 15/3/2009 SvB Maintainance release
FIXED: Stricter type checking on logicals in mice() to evade warnings.
CHANGED: Modernization of all help files.
FIXED: padModel: treatment changed to contr.treatment
CHANGED: Functions check.visitSequence, check.predictorMatrix, check.imputationMethod are now coded as local to mice()
FIXED: existsFunction in check.imputationMethod now works both under S-Plus and R
mice 1.16 - 6/25/2007
FIXED: The impution function impute.logreg used convergence criteria that were too optimistic when fitting a GLM with glm.fit. Thanks to Ulrike Gromping.
mice 1.15 - 01/09/2006
FIXED: In the lm.mids and glm.mids functions, parameters were not passed through to glm and lm.
mice 1.14R - 9/26/2005 11:44AM
FIXED: Passive imputation works again. (Roel de Jong)
CHANGED: Random seed is now left alone, UNLESS the argument "seed" is specified. This means that unless you
specify identical seed values, imputations of the same dataset will be different for multiple calls to mice. (Roel de Jong)
FIXED: (docs): Documentation for "impute.mean" (Roel de Jong)
FIXED: Function 'summary.mids' now works (Roel de Jong)
FIXED: Imputation function 'impute.polyreg' and 'impute.lda' should now work under R
mice 1.13
Changed function checkImputationMethod, Feb 6, 2004
mice 1.12
Maintainance, S-Plus 6.1 and R 1.8 unicode, January 2004
mice 1.1
R version (with help of Peter Malewski and Frank Harrell), Feb 2001