Skip to content

MatchIt

4.8.1Package record

Nonparametric Preprocessing for Parametric Causal Inference

18packages dependsuggested by 20
273.8Kdownloads / year
82.5%test coverage
13/13flavors OK

Overview

About

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.)

Changes in 4.8.1
  • Nearest neighbor matching on large samples is much faster, especially with exact when there are many exact matching strata.
  • Optimal, full, and quick matching with exact are faster when there are many exact matching strata, as is method = "cem" with k2k = TRUE and a k2k.method computed by dist().
  • 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 with subclass = TRUE.
  • With method = "cardinality" and solver = "highs", reaching the time limit set by time now 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() with subclass = TRUE in 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() with subclass = TRUE in 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 both subclass = TRUE and interactions = TRUE after 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() with subclass = TRUE in 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() with interactions = TRUE after 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" with k2k = TRUE and estimand = "ATC" would yield an error when k2k.method was one computed by dist(), such as "maximum" or "manhattan".
  • Fixed a bug with method = "quick" in which, when some units were discarded (e.g., using discard), 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" and method = "full" in which, when some units were discarded and an exact matching 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., with distance = "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

CRAN checks
13OK
Slowest check: 10.6 min · r-oldrel-windows-x86_64
Status changes
  • 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
Advisories

none known

Documentation

In release 4.8.1
README· In the repository, left out of the releaseVignettesYes · 5 · dynamicNEWSYes · 100% structured · mentions 4.8.1Citation fileYes · cites a publicationWebsiteYes · pkgdown
Cites a JSS article
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

273.8K
CRAN downloads in the past year
Rank #790 · ~750/day · ~22.8K/mo
Daily download trend is not available in this view yet.
23.3K30 days
59.3K90 days
273.8K1 year
Compare downloads with other packages →
Also on3.9K r2u10 autocran8.3K conda_forge399 c2d4u

Repository

239Stars
51Forks
4Open issues
0Open PRs
2Releases
1,991Commits
23Commit identities
1,991 commits · Last activity 2026-09-25 · +0.8% stars, 30d
Responsiveness
How these are sampled
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

2025-09-18 · 2272026-09-25 · 239
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux

Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-09-26 · The repository has a site deploy workflow

pkgdown site last built 2026-09-26

CRAN release process (1)
CRAN-SUBMISSION
Lint, format, editor (2)
lintrRStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-06-22
    Seen in the repository: .claude
    Named in .Rbuildignore: .claude, CLAUDE.md
    Named in .gitignore: .claude, CLAUDE.md
    Commits: at least 19 crediting it in the message
Models named in its commits
  • Claude Opus 5.510 commits · Sep 2026
  • Claude Opus 59 commits · Aug to Sep 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
25 external dependencies (excludes base and recommended)

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.

Depends (1)
R >= 4.1.0
Imports (7)
argrlangRcpputilsstatsgraphicsgrDevices
LinkingTo (2)
Enhances (0)
none

Datasets

People & History

People (6)
Maintainer since 4.0.0 (2020), Author · added in 4.0.0
Author
Author
Contributor · added in 3.0.1

Previously maintained by Kosuke Imai (2.1-3 to 3.0.2) and Daniel Ho (1.0-1 to 2.1-2).

Releases (56)

Pick two releases to compare their code metrics.

Show 70 earlier eventsHide 70 earlier events

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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for MatchIt version 4.8.1 [Data set]. HJJB, LLC. Data release v2026-10-19. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy