Nonparametric Preprocessing for Parametric Causal Inference
Overview
Selects matched samples of the original treated and control groups with similar covariate distributions -- can be used to match exactly on covariates, to match on propensity scores, or perform a variety of other matching procedures. The package also implements a series of recommendations offered in Ho, Imai, King, and Stuart (2007) DOI:10.1093/pan/mpl013. (The 'gurobi' package, which is not on CRAN, is optional and comes with an installation of the Gurobi Optimizer, available at https://www.gurobi.com.)
- Nearest neighbor matching on large samples is much faster, especially with
exactwhen there are many exact matching strata. - Optimal, full, and quick matching with
exactare faster when there are many exact matching strata, as ismethod = "cem"withk2k = TRUEand ak2k.methodcomputed bydist(). summary()is faster on large samples, especially in computing pair distances when strata are large (as with exact, coarsened exact, and full matching) and balance statistics within subclasses withsubclass = TRUE.- With
method = "cardinality"andsolver = "highs", reaching the time limit set bytimenow returns the best solution found so far with a warning, as with the other solvers. Previously, this was an error even when a usable solution had been found. - Fixed a bug in
summary()withsubclass = TRUEin which the eCDF and eQQ statistics for a subclass were wrong when a covariate that is not binary took only the values 0 and 1 within that subclass. - Fixed a bug in
summary()withsubclass = TRUEin which the eCDF and eQQ statistics within each subclass ignored the sampling weights, unlike the other balance statistics. - Fixed a bug in
summary()in which setting bothsubclass = TRUEandinteractions = TRUEafter subclassification would yield an error (introduced in 4.8.0). The balance tables for individual subclasses now contain the same interactions as the aggregate table; previously, they also included squares of dummy variables and products of dummy variables for the same factor. - Fixed a bug in
summary()withsubclass = TRUEin which the standardized mean differences within each subclass were standardized by the standard deviation of the treated or control units in that subclass rather than in the full sample. They now use the same standardization factor as the aggregate balance statistics. - Fixed a bug in
summary()withinteractions = TRUEafter subclassification in which the standardized mean differences of the interactions in the aggregate balance table were standardized by the standard deviation of the treated units regardless of the estimand. - Fixed a bug where using
method = "cem"withk2k = TRUEandestimand = "ATC"would yield an error whenk2k.methodwas one computed bydist(), such as"maximum"or"manhattan". - Fixed a bug with
method = "quick"in which, when some units were discarded (e.g., usingdiscard), the subclasses were assigned to the wrong units, so that discarded units were placed in subclasses and some retained units were not. - Fixed a bug with
method = "optimal"andmethod = "full"in which, when some units were discarded and anexactmatching stratum was left with one treated and one control unit, those two units were not matched to each other and other units, including discarded ones, were placed in their subclass instead.
Show all changes in 4.8.1Hide the rest of the changes in 4.8.1
- Fixed a bug with
method = "nearest"in which a covariate caliper could exclude control units it should have allowed because of rounding error when the caliper variable was also used in the distance (e.g., withdistance = "scaled_euclidean"or"mahalanobis"). This happened when a control unit's difference from a treated unit on the caliper variable was at or within rounding error of the caliper width, which is common with discrete covariates; matches in such cases may differ from previous versions.
From NEWS.md in the release
Install
Health
- OK13 OK2026-10-04
- ERROR10 OK, 2 NOTE, 1 ERROR2026-09-17
- NOTE12 OK, 1 NOTE2026-07-11
- OK12 OK2026-04-25
- NOTE11 OK, 3 NOTE2026-04-22
Show 4 earlier changesHide 4 earlier changes
- ERROR10 OK, 3 NOTE, 1 ERROR2026-04-18
- NOTE11 OK, 3 NOTE2026-04-10
- ERROR10 OK, 3 NOTE, 1 ERROR2026-04-09
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 20 (1 internal)includes a package overview page
- Examples that run
- 100%18 run in a plain check (7 of them under a condition)
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 60%
Downloads
Repository
- PRs merged (all time)
- 84%
- Median days to close, 50 most recently updated closed issues
- 32
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
9 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/kosukeimai/matchit on 2026-10-11.
The R CMD check workflow runs on Linux
GitHub Pages site last deployed 2026-09-26 · The repository has a site deploy workflow
pkgdown site last built 2026-09-26
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-06-22Seen in the repository: .claudeNamed in .Rbuildignore: .claude, CLAUDE.mdNamed in .gitignore: .claude, CLAUDE.mdCommits: at least 19 crediting it in the message
- Claude Opus 5.510 commits · Sep 2026
- Claude Opus 59 commits · Aug to Sep 2026
Dependencies
Installing MatchIt adds 5 packages (3 with compiled code, 3.3 MB of source tarballs). Heaviest: Rcpp 1.8 MB, rlang 766 KB, cli 629 KB.
Show all 38 packagesHide all 38 packages
Code & Tests
Datasets
People & History
Previously maintained by Kosuke Imai (2.1-3 to 3.0.2) and Daniel Ho (1.0-1 to 2.1-2).
Pick two releases to compare their code metrics.
- 4.8.1Latest
- 4.8.02026-09-17 · diff ↗
- RR 4.6.0 released · 2026-04-24
- 4.7.22025-05-30 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 4.7.12025-03-10 · diff ↗
- 4.7.0
- 4.6.02024-11-13 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 4.5.52023-10-13 · diff ↗
- 4.5.42023-06-14 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 4.5.32023-04-13 · diff ↗
- 4.5.22023-03-22 · diff ↗
- 4.5.12023-02-23 · diff ↗
- 4.5.02022-11-16 · diff ↗
Show 70 earlier eventsHide 70 earlier events
- 4.4.02022-05-19 · diff ↗ ·
added 4 exports
euclidean_dist, scaled_euclidean_dist, mahalanobis_dist, robust_mahalanobis_dist - RR 4.2.0 released · 2022-04-22
- 4.3.42022-03-08 · diff ↗
- 4.3.32022-01-20 · diff ↗
- 4.3.22021-11-24 · diff ↗
- 4.3.12021-11-11 · diff ↗
- 4.3.02021-09-13 · diff ↗
- 4.2.02021-05-26 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 4.1.02020-12-15 · diff ↗
- 4.0.12020-11-27 · diff ↗
- 4.0.02020-11-14 · diff ↗ ·
removed 3 exports
help.matchit, is.matchit, user.promptadded 1 export
add_s.weights - RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- 3.0.22018-01-09 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 3.0.1
- 2.4-222017-02-22 · diff ↗
- RR 3.3.0 released · 2016-05-03
- RR 3.2.0 released · 2015-04-16
- RR 3.1.0 released · 2014-04-10
- 2.4-212013-06-28 · diff ↗
- RR 3.0.0 released · 2013-04-03
- RR 2.15.0 released · 2012-03-30
- RR 2.14.0 released · 2011-10-31
- 2.4-202011-10-24 · diff ↗
- 2.4-182011-04-26 · diff ↗
- RR 2.13.0 released · 2011-04-13
- 2.4-172011-04-04 · diff ↗
- 2.4-162011-01-10 · diff ↗
- 2.4-152010-12-13 · diff ↗
- RR 2.12.0 released · 2010-10-15
- 2.4-142010-08-12 · diff ↗
- RR 2.11.0 released · 2010-04-22
- RR 2.10.0 released · 2009-10-26
- 2.4-112009-06-26 · diff ↗
- RR 2.9.0 released · 2009-04-17
- 2.4-102009-02-03 · diff ↗
- RR 2.8.0 released · 2008-10-20
- 2.4-72008-08-06 · diff ↗
- 2.4-52008-07-21 · diff ↗
- 2.4-42008-07-20 · diff ↗
- RR 2.7.0 released · 2008-04-22
- 2.3-12007-10-12 · diff ↗
- RR 2.6.0 released · 2007-10-03
- RR 2.5.0 released · 2007-04-24
- 2.2-132007-04-11 · diff ↗
- RR 2.4.0 released · 2006-10-03
- 2.2-112006-07-14 · diff ↗
- 2.2-10
- 2.2-82006-05-02 · diff ↗
- RR 2.3.0 released · 2006-04-24
- 2.2-72006-04-13 · diff ↗
- 2.2-62006-04-05 · diff ↗
- 2.2-52005-12-08 · diff ↗
- 2.2-42005-12-07 · diff ↗
- 2.2-32005-11-20 · diff ↗
- 2.2-22005-11-10 · diff ↗
- 2.2-12005-11-02 · diff ↗
- 2.1-42005-10-16 · diff ↗
- 2.1-32005-10-07 · diff ↗
- RR 2.2.0 released · 2005-10-06
- 2.1-22005-09-28 · diff ↗
- 2.1-12005-09-17 · diff ↗
- 2.0-12005-08-30 · diff ↗ ·
removed 12 exports
matchdef, diagnose, distance, subclassify, exactmatch, neyman, print.matchit, print.summary.matchit, print.summary.neyman, plot.matchit, summary.matchit, summary.neyman - 1.0-22005-08-11 · diff ↗
- RR 2.1.0 released · 2005-04-18
- 1.0-12005-01-06
- RR 2.0.0 released · 2004-10-04
Package metadata
- First published
- 2005-01-06
- Total releases
- 56 / 21 yrs
- License
- GPL (>= 2) OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 29 KB / 1 file
- Download size
- 1.7 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("MatchIt")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.18637/jss.v042.i08.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.