Nearest-neighbor propensity score matching
Enter aligned comma-separated scores and outcomes; controls are used once in input order.
About propensity score matching
Propensity score matching is a design technique for observational studies where treatment was not randomly assigned. A propensity score is the estimated probability that an observation receives treatment given measured pre-treatment covariates. Observations with similar scores have similar modeled treatment likelihoods. Matching treated observations to comparable untreated controls can improve covariate balance and create a more credible comparison than an unadjusted difference in outcomes.
This calculator performs greedy one-to-one nearest-neighbor matching without replacement. It considers treated observations in the order entered, finds the unused control with the smallest absolute propensity-score distance, assigns that control, and removes it from later consideration. The reported average treatment effect on the treated, or ATT, is the mean of the treated outcome minus its matched control outcome across all pairs. A positive ATT indicates a higher average observed outcome among treated units under the chosen outcome scale.
The score and outcome lists must align: the first treated score belongs to the first treated outcome, and the same rule applies to controls. Propensity scores must lie from zero to one. Because matching is without replacement, the control pool must contain at least as many observations as the treated pool. Greedy results can depend on treated input order, especially when several controls compete for similar scores. Optimal matching software may produce a lower total distance.
A close propensity score does not by itself prove that every covariate is balanced. After matching, inspect standardized mean differences, distributions, overlap, and sample retention for each important baseline variable. Scores should be estimated only from variables measured before treatment, including plausible confounders rather than post-treatment consequences. Poor overlap means some treated observations have no credible controls; a caliper or trimming rule is then often preferable to forced matches.
Causal interpretation requires assumptions that no important confounder is unmeasured, treatment assignment is possible across relevant covariate patterns, observations do not interfere, and models are adequately specified. Matching does not manufacture randomization or remove hidden bias. Standard errors also need methods that reflect matching and score estimation. Use this lightweight calculator to understand deterministic pairing and verify small examples. For publishable analysis, use statistical software that supports calipers, ties, replacement choices, balance diagnostics, sensitivity analysis, and suitable uncertainty estimates.
Propensity score matching FAQ
What is a propensity score?
It is an estimated probability of receiving treatment conditional on measured baseline covariates. It summarizes those modeled covariates for matching but does not account for unmeasured confounding.
What does matching without replacement mean?
Each control can be assigned to at most one treated observation. This preserves unique controls but may make later matches less similar.
Why can input order change the result?
Greedy matching assigns the nearest available control sequentially. An early assignment can remove a control that would have been the best match for a later treated unit.
What does ATT measure?
ATT estimates the average outcome contrast for treated observations against their matched control outcomes. A causal reading requires adequate balance, overlap, and no important unmeasured confounding.
Should distant matches be accepted?
Usually they should be investigated and may be excluded with a prespecified caliper. Forced distant matches can increase bias even though they retain more observations.