35.8 Software and Practical Implementation

Many R packages provide functionality for implementing the various matching methods discussed above. Below is an overview of some popular options:

  • MatchIt:
    Implements a wide range of matching methods (nearest neighbor, optimal, full, subclassification, exact, etc.). It focuses on “preprocessing” data before a final outcome analysis.

  • Matching:
    Provides multivariate and propensity score matching, including options for exact and nearest neighbor matching. The package also offers functions to evaluate balance and to conduct sensitivity analyses.

  • cem (Coarsened Exact Matching):
    Uses a coarsening approach to create strata within which exact matching can be performed. This can reduce imbalance by discarding units that do not overlap in coarsened covariate space.

  • optmatch:
    Enables optimal matching with variable matching ratios and full matching, allowing for flexible group constructions that minimize overall distance.

  • MatchingFrontier (G. King, Lucas, and Nielsen 2017):
    Finds the “frontier” of matching solutions by balancing sample size (or other constraints) against covariate balance. Allows analysts to see trade-offs in real time.

  • CBPS (Covariate Balancing Propensity Score):
    Estimates propensity scores such that covariate balance is directly optimized. This can help avoid iterative re-specification of the propensity score model.

  • PanelMatch (Rauh, Kim, and Imai 2025):
    Tailored to panel (longitudinal) data settings, providing matching methods that exploit repeated observations over time (e.g., for DID-type analyses in a time-series cross-sectional environment).

  • PSAgraphics:
    Specializes in visual diagnostics for propensity score analyses, offering graphical tools to inspect balance and common support.

  • rbounds:
    Conducts Rosenbaum bounds sensitivity analysis on matched data. Researchers can examine how a hypothetical unmeasured confounder could undermine their estimated treatment effects.

  • twang:
    Implements generalized boosted models (GBM) to estimate propensity scores. Often used for weighting approaches such as inverse probability weighting (IPW).

In practice, the choice of software and methods hinges on the study design, the nature of the data, and the researcher’s theoretical expectations regarding treatment assignment.


References

King, Gary, Christopher Lucas, and Richard A Nielsen. 2017. “The Balance-Sample Size Frontier in Matching Methods for Causal Inference.” American Journal of Political Science 61 (2): 473–89.
Rauh, Adam, In Song Kim, and Kosuke Imai. 2025. “PanelMatch: Matching Methods for Causal Inference with Time-Series Cross-Section Data.” arXiv Preprint arXiv:2503.02073.