mice/ 0000755 0001762 0000144 00000000000 14437371703 011200 5 ustar ligges users mice/NAMESPACE 0000644 0001762 0000144 00000014167 14436636520 012430 0 ustar ligges users # Generated by roxygen2: do not edit by hand
S3method(anova,mira)
S3method(bwplot,mads)
S3method(bwplot,mids)
S3method(cc,data.frame)
S3method(cc,default)
S3method(cc,matrix)
S3method(cc,mids)
S3method(cci,default)
S3method(cci,mids)
S3method(complete,mids)
S3method(densityplot,mids)
S3method(filter,mids)
S3method(glance,mipo)
S3method(ic,data.frame)
S3method(ic,default)
S3method(ic,matrix)
S3method(ic,mids)
S3method(ici,default)
S3method(ici,mids)
S3method(mcar,data.frame)
S3method(plot,mcar_object)
S3method(plot,md.pattern)
S3method(plot,mids)
S3method(print,mads)
S3method(print,mcar_object)
S3method(print,mice.anova)
S3method(print,mice.anova.summary)
S3method(print,mids)
S3method(print,mipo)
S3method(print,mipo.summary)
S3method(print,mira)
S3method(stripplot,mids)
S3method(summary,mads)
S3method(summary,mice.anova)
S3method(summary,mids)
S3method(summary,mipo)
S3method(summary,mira)
S3method(tidy,mipo)
S3method(with,mids)
S3method(xyplot,mads)
S3method(xyplot,mids)
export(.norm.draw)
export(.pmm.match)
export(D1)
export(D2)
export(D3)
export(ampute)
export(ampute.continuous)
export(ampute.default.freq)
export(ampute.default.odds)
export(ampute.default.patterns)
export(ampute.default.type)
export(ampute.default.weights)
export(ampute.discrete)
export(ampute.mcar)
export(appendbreak)
export(as.mids)
export(as.mira)
export(as.mitml.result)
export(bwplot)
export(cbind)
export(cc)
export(cci)
export(complete)
export(construct.blocks)
export(convergence)
export(densityplot)
export(estimice)
export(extractBS)
export(fico)
export(filter)
export(fix.coef)
export(flux)
export(fluxplot)
export(futuremice)
export(getfit)
export(getqbar)
export(glance)
export(glm.mids)
export(ibind)
export(ic)
export(ici)
export(is.mads)
export(is.mids)
export(is.mipo)
export(is.mira)
export(is.mitml.result)
export(lm.mids)
export(make.blocks)
export(make.blots)
export(make.formulas)
export(make.method)
export(make.post)
export(make.predictorMatrix)
export(make.visitSequence)
export(make.where)
export(matchindex)
export(mcar)
export(md.pairs)
export(md.pattern)
export(mdc)
export(mice)
export(mice.impute.2l.bin)
export(mice.impute.2l.lmer)
export(mice.impute.2l.norm)
export(mice.impute.2l.pan)
export(mice.impute.2lonly.mean)
export(mice.impute.2lonly.norm)
export(mice.impute.2lonly.pmm)
export(mice.impute.cart)
export(mice.impute.jomoImpute)
export(mice.impute.lasso.logreg)
export(mice.impute.lasso.norm)
export(mice.impute.lasso.select.logreg)
export(mice.impute.lasso.select.norm)
export(mice.impute.lda)
export(mice.impute.logreg)
export(mice.impute.logreg.boot)
export(mice.impute.mean)
export(mice.impute.midastouch)
export(mice.impute.mnar.logreg)
export(mice.impute.mnar.norm)
export(mice.impute.mpmm)
export(mice.impute.norm)
export(mice.impute.norm.boot)
export(mice.impute.norm.nob)
export(mice.impute.norm.predict)
export(mice.impute.panImpute)
export(mice.impute.passive)
export(mice.impute.pmm)
export(mice.impute.polr)
export(mice.impute.polyreg)
export(mice.impute.quadratic)
export(mice.impute.rf)
export(mice.impute.ri)
export(mice.impute.sample)
export(mice.mids)
export(mice.theme)
export(mids2mplus)
export(mids2spss)
export(mipo)
export(name.blocks)
export(name.formulas)
export(ncc)
export(nelsonaalen)
export(nic)
export(nimp)
export(norm.draw)
export(parlmice)
export(pool)
export(pool.compare)
export(pool.r.squared)
export(pool.scalar)
export(pool.scalar.syn)
export(pool.syn)
export(quickpred)
export(rbind)
export(squeeze)
export(stripplot)
export(supports.transparent)
export(tidy)
export(version)
export(xyplot)
exportClasses(mads)
exportClasses(mira)
import(methods)
importFrom(Rcpp,evalCpp)
importFrom(broom,glance)
importFrom(broom,tidy)
importFrom(dplyr,"%>%")
importFrom(dplyr,bind_cols)
importFrom(dplyr,bind_rows)
importFrom(dplyr,filter)
importFrom(dplyr,group_by)
importFrom(dplyr,lead)
importFrom(dplyr,mutate)
importFrom(dplyr,n)
importFrom(dplyr,pull)
importFrom(dplyr,row_number)
importFrom(dplyr,select)
importFrom(dplyr,summarize)
importFrom(generics,glance)
importFrom(generics,tidy)
importFrom(glmnet,cv.glmnet)
importFrom(grDevices,dev.off)
importFrom(graphics,abline)
importFrom(graphics,axis)
importFrom(graphics,box)
importFrom(graphics,hist)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,plot.new)
importFrom(graphics,plot.window)
importFrom(graphics,points)
importFrom(graphics,rect)
importFrom(graphics,text)
importFrom(lattice,bwplot)
importFrom(lattice,densityplot)
importFrom(lattice,stripplot)
importFrom(lattice,xyplot)
importFrom(mitml,jomoImpute)
importFrom(mitml,mitmlComplete)
importFrom(mitml,panImpute)
importFrom(mitml,testModels)
importFrom(nnet,multinom)
importFrom(rlang,.data)
importFrom(rlang,syms)
importFrom(rpart,rpart)
importFrom(rpart,rpart.control)
importFrom(stats,C)
importFrom(stats,aggregate)
importFrom(stats,as.formula)
importFrom(stats,binomial)
importFrom(stats,coef)
importFrom(stats,complete.cases)
importFrom(stats,confint)
importFrom(stats,contr.treatment)
importFrom(stats,cor)
importFrom(stats,cov)
importFrom(stats,df.residual)
importFrom(stats,fitted)
importFrom(stats,formula)
importFrom(stats,gaussian)
importFrom(stats,getCall)
importFrom(stats,glm)
importFrom(stats,is.empty.model)
importFrom(stats,lm)
importFrom(stats,lm.fit)
importFrom(stats,median)
importFrom(stats,model.frame)
importFrom(stats,model.matrix)
importFrom(stats,na.exclude)
importFrom(stats,na.omit)
importFrom(stats,na.pass)
importFrom(stats,pchisq)
importFrom(stats,pf)
importFrom(stats,predict)
importFrom(stats,pt)
importFrom(stats,qt)
importFrom(stats,quantile)
importFrom(stats,quasibinomial)
importFrom(stats,rbinom)
importFrom(stats,rchisq)
importFrom(stats,reformulate)
importFrom(stats,rgamma)
importFrom(stats,rnorm)
importFrom(stats,runif)
importFrom(stats,sd)
importFrom(stats,spline)
importFrom(stats,summary.glm)
importFrom(stats,terms)
importFrom(stats,update)
importFrom(stats,var)
importFrom(stats,vcov)
importFrom(tidyr,complete)
importFrom(utils,askYesNo)
importFrom(utils,flush.console)
importFrom(utils,head)
importFrom(utils,install.packages)
importFrom(utils,methods)
importFrom(utils,packageDescription)
importFrom(utils,packageVersion)
importFrom(utils,tail)
importFrom(utils,write.table)
useDynLib(mice, .registration = TRUE)
mice/README.md 0000644 0001762 0000144 00000015463 14436104377 012470 0 ustar ligges users
# mice
[](https://cran.r-project.org/package=mice)
[](https://cran.r-project.org/package=mice)
[](https://github.com/amices/mice/actions/workflows/R-CMD-check.yaml)
[](https://amices.org/mice/)
## [Multivariate Imputation by Chained Equations](https://amices.org/mice/)
The [`mice`](https://cran.r-project.org/package=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:
``` r
install.packages("mice")
```
The latest version can be installed from GitHub as follows:
``` r
install.packages("devtools")
devtools::install_github(repo = "amices/mice")
```
## Minimal example
``` r
library(mice, warn.conflicts = FALSE)
# show the missing data pattern
md.pattern(nhanes)
```

#> age hyp bmi chl
#> 13 1 1 1 1 0
#> 3 1 1 1 0 1
#> 1 1 1 0 1 1
#> 1 1 0 0 1 2
#> 7 1 0 0 0 3
#> 0 8 9 10 27
The table and the graph summarize where the missing data occur in the
`nhanes` dataset.
``` r
# multiple impute the missing values
imp <- mice(nhanes, maxit = 2, m = 2, seed = 1)
#>
#> iter imp variable
#> 1 1 bmi hyp chl
#> 1 2 bmi hyp chl
#> 2 1 bmi hyp chl
#> 2 2 bmi hyp chl
# inspect quality of imputations
stripplot(imp, chl, pch = 19, xlab = "Imputation number")
```

In general, we would like the imputations to be plausible, i.e., values
that could have been observed if they had not been missing.
``` r
# fit complete-data model
fit <- with(imp, lm(chl ~ age + bmi))
# pool and summarize the results
summary(pool(fit))
#> term estimate std.error statistic df p.value
#> 1 (Intercept) 9.08 73.09 0.124 4.50 0.9065
#> 2 age 35.23 17.46 2.017 1.36 0.2377
#> 3 bmi 4.69 1.94 2.417 15.25 0.0286
```
The complete-data is fit to each imputed dataset, and the results are
combined to arrive at estimates that properly account for the missing
data.
## `mice 3.0`
Version 3.0 represents a major update that implements the following
features:
1. `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;
2. `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;
3. 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;
4. `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.
5. Better integration with the `tidyverse` framework, especially for
packages `dplyr`, `tibble` and `broom`;
6. Improved numerical algorithms for low-level imputation function.
Better handling of duplicate variables.
7. Last but not least: A brand new edition AND online version of
[Flexible Imputation of Missing Data. Second
Edition.](https://stefvanbuuren.name/fimd/)
See [MICE: Multivariate Imputation by Chained
Equations](https://amices.org/mice/) for more resources.
I’ll be happy to take feedback and discuss suggestions. Please submit
these through Github’s issues facility.
## Resources
### Books
1. Van Buuren, S. (2018). [Flexible Imputation of Missing Data. Second
Edition.](https://stefvanbuuren.name/fimd/). Chapman & Hall/CRC.
Boca Raton, FL.
### Course materials
1. [Handling Missing Data in `R` with
`mice`](https://amices.org/Winnipeg/)
2. [Statistical Methods for combined data
sets](https://stefvanbuuren.name/RECAPworkshop/)
### Vignettes
1. [Ad hoc methods and the MICE
algorithm](https://www.gerkovink.com/miceVignettes/Ad_hoc_and_mice/Ad_hoc_methods.html)
2. [Convergence and
pooling](https://www.gerkovink.com/miceVignettes/Convergence_pooling/Convergence_and_pooling.html)
3. [Inspecting how the observed data and missingness are
related](https://www.gerkovink.com/miceVignettes/Missingness_inspection/Missingness_inspection.html)
4. [Passive imputation and
post-processing](https://www.gerkovink.com/miceVignettes/Passive_Post_processing/Passive_imputation_post_processing.html)
5. [Imputing multilevel
data](https://www.gerkovink.com/miceVignettes/Multi_level/Multi_level_data.html)
6. [Sensitivity analysis with
`mice`](https://www.gerkovink.com/miceVignettes/Sensitivity_analysis/Sensitivity_analysis.html)
7. [Generate missing values with
`ampute`](https://rianneschouten.github.io/mice_ampute/vignette/ampute.html)
8. [`futuremice`: Wrapper for parallel MICE imputation through
futures](https://www.gerkovink.com/miceVignettes/futuremice/Vignette_futuremice.html)
### Code from publications
1. [Flexible Imputation of Missing Data. Second
edition.](https://github.com/stefvanbuuren/fimdbook/tree/master/R)
## Acknowledgement
The cute mice sticker was designed by Jaden M. Walters. Thanks Jaden!
## Code of Conduct
Please note that the mice project is released with a [Contributor Code
of Conduct](https://amices.org/mice/CODE_OF_CONDUCT.html). By
contributing to this project, you agree to abide by its terms.
mice/data/ 0000755 0001762 0000144 00000000000 13707271524 012110 5 ustar ligges users mice/data/pattern3.rda 0000644 0001762 0000144 00000000274 13666252075 014347 0 ustar ligges users ];0KҊ
YD?]Z'\?\.wtH:D$I AR!$AE؛ocmV"\B)RA0jrI]anY+[vk}Q@a C>8}sRߌ5wq9Z[ mice/data/toenail.rda 0000755 0001762 0000144 00000012525 13666252075 014247 0 ustar ligges users BZh91AY&SY?N c$ @ R@B 0 h h h
h h UIOT @ ~ cꪪꪧꑠd4i M2d4hhhF4шL&FC L0C#CFFED4mLSMOb(QOTy'&FɧG1 <zOIGhzGz5&O)ɩz6MN@~ 0I $$$da-,>HOnٍ"6rׅs9f "[l@d -%,5;4SacO@1zl`ƛqFLm&)xg7kN>$::bGCI$4zk3q8XeN܂C;ϕS9g1pi2c6Ml
\i.b䤺Imθ3$Sft&/٦钳)$M5f]]MM~Dˮ}fq@?ñ|.ӫoq|1)