{"id":21425272,"url":"https://github.com/amices/mice","last_synced_at":"2025-12-12T01:05:13.570Z","repository":{"id":7556814,"uuid":"8910139","full_name":"amices/mice","owner":"amices","description":"Multivariate Imputation by Chained Equations","archived":false,"fork":false,"pushed_at":"2025-08-12T23:03:12.000Z","size":172455,"stargazers_count":486,"open_issues_count":31,"forks_count":119,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-09-08T12:55:29.254Z","etag":null,"topics":["chained-equations","fcs","imputation","mice","missing-data","missing-values","multiple-imputation","multivariate-data"],"latest_commit_sha":null,"homepage":"https://amices.org/mice/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amices.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.html","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2013-03-20T17:26:01.000Z","updated_at":"2025-09-05T06:14:18.000Z","dependencies_parsed_at":"2024-04-17T15:50:56.784Z","dependency_job_id":"09a0cf01-2f20-4f70-a7f6-dd23832c64d8","html_url":"https://github.com/amices/mice","commit_stats":{"total_commits":1394,"total_committers":38,"mean_commits":36.68421052631579,"dds":"0.28192252510760407","last_synced_commit":"538f6146198cadc165279219f5ee627fd111f114"},"previous_names":["stefvanbuuren/mice"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/amices/mice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amices%2Fmice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amices%2Fmice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amices%2Fmice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amices%2Fmice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amices","download_url":"https://codeload.github.com/amices/mice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amices%2Fmice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280391675,"owners_count":26322962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chained-equations","fcs","imputation","mice","missing-data","missing-values","multiple-imputation","multivariate-data"],"created_at":"2024-11-22T21:27:39.109Z","updated_at":"2025-10-22T06:24:49.457Z","avatar_url":"https://github.com/amices.png","language":"R","readme":"---\noutput:\n  md_document:\n    variant: gfm\nbibliography: refs.bibtex\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\noptions(width = 60, digits = 3)\nset.seed(1)\n```\n\n# mice \u003ca href=\"https://amices.org/mice/\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"139\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/mice)](https://cran.r-project.org/package=mice)\n[![](https://cranlogs.r-pkg.org/badges/mice)](https://cran.r-project.org/package=mice)\n[![R-CMD-check](https://github.com/amices/mice/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/amices/mice/actions/workflows/R-CMD-check.yaml)\n[![](https://img.shields.io/badge/github%20version-3.18.1-orange.svg)](https://amices.org/mice/)\n\u003c!-- badges: end --\u003e\n\n## [Multivariate Imputation by Chained Equations](https://amices.org/mice/)\n\nThe [`mice`](https://cran.r-project.org/package=mice) package\nimplements a method to deal with missing data. The package creates\nmultiple imputations (replacement values) for multivariate missing\ndata. The method is based on Fully Conditional Specification, where\neach incomplete variable is imputed by a separate model. The `MICE`\nalgorithm can impute mixes of continuous, binary, unordered\ncategorical and ordered categorical data. In addition, MICE can impute\ncontinuous two-level data, and maintain consistency between\nimputations by means of passive imputation. Many diagnostic plots are\nimplemented to inspect the quality of the imputations.\n\n## Installation\n\nThe `mice` package can be installed from CRAN as follows:\n\n```{r eval = FALSE}\ninstall.packages(\"mice\")\n```\n\nThe latest version can be installed from GitHub as follows: \n\n```{r eval = FALSE}\ninstall.packages(\"devtools\")\ndevtools::install_github(repo = \"amices/mice\")\n```\n\n\n## Minimal example\n\n```{r pattern, fig.cap = \"Missing data pattern of `nhanes` data. Blue is observed, red is missing.\"}\nlibrary(mice, warn.conflicts = FALSE)\n\n# show the missing data pattern\nmd.pattern(nhanes)\n```\n\nThe table and the graph summarize where the missing data occur in \nthe `nhanes` dataset.\n\n```{r stripplot, fig.cap = \"Distribution of `chl` per imputed data set.\"}\n# multiple impute the missing values\nimp \u003c- mice(nhanes, maxit = 2, m = 2, seed = 1)\n\n# inspect quality of imputations\nstripplot(imp, chl, pch = 19, xlab = \"Imputation number\")\n```\n\nIn general, we would like the imputations to be plausible, i.e., \nvalues that could have been observed if they had not been missing.\n\n```{r}\n# fit complete-data model\nfit \u003c- with(imp, lm(chl ~ age + bmi))\n\n# pool and summarize the results\nsummary(pool(fit))\n```\n\nThe complete-data is fit to each imputed dataset, and the \nresults are combined to arrive at estimates that properly \naccount for the missing data.\n\n## `mice 3.0`\n\nVersion 3.0 represents a major update that implements the \nfollowing features: \n\n1. `blocks`: The main algorithm iterates over blocks. A block is\n    simply a collection of variables. In the common MICE algorithm each \n    block was equivalent to one variable, which - of course - is \n    the default; The `blocks` argument allows mixing univariate \n    imputation method multivariate imputation methods. The `blocks` \n    feature bridges two seemingly disparate approaches, joint modeling \n    and fully conditional specification, into one framework;\n\n2. `where`: The `where` argument is a logical matrix of the same size \n    of `data` that specifies which cells should be imputed. This opens \n    up some new analytic possibilities;\n    \n3.  Multivariate tests: There are new functions `D1()`, `D2()`, `D3()`\n    and `anova()` that perform multivariate parameter tests on the \n    repeated analysis from on multiply-imputed data;\n\n4. `formulas`: The old `form` argument has been redesign and is now \n    renamed to `formulas`. This provides an alternative way to specify\n    imputation models that exploits the full power of R's native \n    formula's. \n\n5.  Better integration with the `tidyverse` framework, especially \n    for packages `dplyr`, `tibble` and  `broom`;\n   \n6.  Improved numerical algorithms for low-level imputation function. \n    Better handling of duplicate variables.\n\n7.  Last but not least: A brand new edition AND online version of\n    [Flexible Imputation of Missing Data. Second Edition.](https://stefvanbuuren.name/fimd/)\n\nSee [MICE: Multivariate Imputation by Chained Equations](https://amices.org/mice/) \nfor more resources.\n\nI'll be happy to take feedback and discuss suggestions. Please submit these \nthrough Github's issues facility.\n\n\n## Resources\n\n### Books\n\n1. Van Buuren, S. (2018). [Flexible Imputation of Missing Data. Second Edition.](https://stefvanbuuren.name/fimd/). Chapman \u0026 Hall/CRC. Boca Raton, FL.\n\n### Course materials\n\n1. [Handling Missing Data in `R` with `mice`](https://amices.org/Winnipeg/)\n2. [Statistical Methods for combined data sets](https://stefvanbuuren.name/RECAPworkshop/)\n\n### Vignettes\n\n1. [Ad hoc methods and the MICE algorithm](https://www.gerkovink.com/miceVignettes/Ad_hoc_and_mice/Ad_hoc_methods.html)\n2. [Convergence and pooling](https://www.gerkovink.com/miceVignettes/Convergence_pooling/Convergence_and_pooling.html)\n3. [Inspecting how the observed data and missingness are related](https://www.gerkovink.com/miceVignettes/Missingness_inspection/Missingness_inspection.html)\n4. [Passive imputation and post-processing](https://www.gerkovink.com/miceVignettes/Passive_Post_processing/Passive_imputation_post_processing.html)\n5. [Imputing multilevel data](https://www.gerkovink.com/miceVignettes/Multi_level/Multi_level_data.html)\n6. [Sensitivity analysis with `mice`](https://www.gerkovink.com/miceVignettes/Sensitivity_analysis/Sensitivity_analysis.html)\n7. [Generate missing values with `ampute`](https://rianneschouten.github.io/mice_ampute/vignette/ampute.html)\n8. [`futuremice`: Wrapper for parallel MICE imputation through futures](https://www.gerkovink.com/miceVignettes/futuremice/Vignette_futuremice.html)\n\n### Code from publications\n\n1. [Flexible Imputation of Missing Data. Second edition.](https://github.com/stefvanbuuren/fimdbook/tree/master/R)\n\n## Acknowledgement\n\nThe cute mice sticker was designed by Jaden M. Walters. Thanks Jaden!\n\n## Code of Conduct\n\nPlease 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.\n\n","funding_links":[],"categories":["❖ Time-Series Imputation Toolkits","Projects"],"sub_categories":["`Algorithms`","Research software"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famices%2Fmice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famices%2Fmice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famices%2Fmice/lists"}