Skip to content
StatsOtter A workspace for causal thinking
Method library WORKFLOW / 071
Research workflow/3 steps

The balance–sample-size frontier (MatchingFrontier)

01
The method workspace

Follow the analysis.

Select a node to explore the method

Method mapInput → 3 steps → output
START WITHInput data
ARRIVE ATResults
Read step 01
Inside the methodReasoning, equations & implementation
Step 1 of 3
01
Data prep

Load MatchIt's lalonde data

Data preparation — shapes the raw inputs into what the estimator expects.

What happens here

Use the canonical Lalonde job-training data and a treatment ~ covariates specification.

Reads fromNot specified Feeds into#2
Key code
# Install:  remotes::install_github("IQSS/MatchingFrontier")
# remotes::install_github("IQSS/MatchingFrontier")
library(MatchingFrontier)
data("lalonde", package = "MatchIt")

Reference / docs ↗

Discussion on this step (0)
StatsOtterDiscussion starter · Editorial note

Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.

Questions to explore
  1. Which assumption matters most here, and what evidence could challenge it?
  2. What would you check before passing this output to the next step?

Peer discussion

  • Bring your experience, a question, or a different perspective.
02
Data contract

Inputs & data

A data frame with a binary treatment and the covariates to balance on.

Show data format & exampleHide example
treat age educ married re74 re75
1 37 11 1 0 0
0 22 9 0 2300 1500
1 30 12 1 0 0
0 45 14 0 9100 8700
03
Read the evidence

Results & interpretation

1 figure Workflow discussion 0
01FigureThe frontier: average imbalance falls as more units are pruned; the ATT estimate is read off at each retained-sample size.

Result figure rendered by StatsOtter from the package's documented example — unofficial community showcase; all credit to the original authors.

The estimate

\text{frontier: }\ \min_{|S|=n}\ \mathrm{Imbalance}(S)\quad\text{for every }n,\ \ \hat\tau(n)=\widehat{\mathrm{ATT}}\big(S^\star(n)\big)

Context & interpretation

⚠️ Unofficial community showcase of MatchingFrontier (docs). Not affiliated with the authors — all credit to Gary King, Christopher Lucas, Richard Nielsen & Noah Greifer; this summarizes public documentation.

What it does. Matching forces a choice: prune more units for better balance, or keep more for precision. MatchingFrontier computes the entire frontier of that tradeoff at once (King, Lucas & Nielsen 2017), so you can see balance and effect estimates as a function of the sample retained instead of guessing one caliper.

How it works. makeFrontier() orders units so that dropping the next-worst one maximally improves an imbalance metric (e.g. Mahalanobis or L1), producing every nested matched subset from all units down to a few. estimateEffects() then fits the outcome model along the frontier and plot() shows how the estimate moves as you trade sample size for balance.

Assumptions. Unconfoundedness given the covariates and overlap; the frontier characterizes bias–variance, it does not remove unmeasured confounding.

What you get — A nested family of matched samples, an imbalance value and an effect estimate at each point on the balance–N frontier.

Example output

A matching frontier with 614 points.
QOI: FSATT   Metric: dist (Mahalanobis)
N ranges from 614 down to 2 units retained.
Use estimateEffects() and plot() to view the effect along the frontier.

Links: package · paper

Peer notes

Discuss the workflow (0)

  • No comments yet — start the conversation.
IN THE MARGINS

Peer discussion