Why Work Through Matches by Hand?
A propensity-score matching algorithm can return a list of matched units, but the list is only useful if its construction is understandable and checkable. Working through a small table by hand makes the key decisions visible: which scores are compared, how distance is calculated, which control is assigned, and which units remain unmatched. The same steps help detect data-entry errors in a larger analysis.
The examples use hypothetical data. Each unit has a treatment indicator and an estimated propensity score. The calculations illustrate one-to-one greedy nearest-neighbor matching: process treated units in a stated order, assign each to the nearest eligible control that has not already been assigned, and do not reuse a control. This is a particular matching rule; its result depends on the chosen rule and order.
Set Up the Calculation
The propensity scores are probabilities, so they fall between 0 and 1. Their difference is measured in propensity-score points, not in the units of any covariate. For example, scores of 0.42 and 0.47 are 0.05 propensity-score points apart. The absolute value matters: a control score can be either above or below the treated unit's score and still be the nearest.
Before calculating, establish the assignment rule. In these examples, each treated unit is processed in the order shown in the table, and each control can be used at most once. At each step, compare the treated unit's score with the scores of the controls still available. A control that has already been assigned is removed from later comparisons. No caliper is imposed here: there is no maximum permitted distance. Thus, an unmatched treated unit in these examples is unmatched because no control remains, not because a distance threshold was exceeded.
For a causal interpretation of an effect estimated from matched data, the matching calculation alone is not sufficient. The usual causal assumptions, including consistency, no interference, conditional exchangeability given measured pre-treatment covariates, and positivity, must also be defensible. Matching cannot establish those assumptions or remove bias from unmeasured confounding.
A Short Justification for the Distance Rule
For each treated unit, the nearest control under this rule is the available control whose score is closest on the number line. If the treated score is \(a\) and a control score is \(b\), their separation is \(|a-b|\). A smaller value means a closer pair. For instance, if \(a=0.40\), then a control at 0.37 is 0.03 away, while a control at 0.46 is 0.06 away. The first is nearer because \(0.03<0.06\).
This establishes how to compare candidates at a single step. It does not establish that the resulting collection of pairs is the best possible arrangement under every possible criterion. The hand calculation follows the stated greedy rule, rather than searching all possible collections of pairs.
Worked Example: Calculating a Complete Distance Table
Suppose a hypothetical study has three treated units and four controls. The treated units are processed in the order T1, T2, T3. Calculate the one-to-one greedy matches.
| Unit | Status | Estimated propensity score |
|---|---|---|
| T1 | Treated | 0.22 |
| T2 | Treated | 0.47 |
| T3 | Treated | 0.71 |
| C1 | Control | 0.19 |
| C2 | Control | 0.35 |
| C3 | Control | 0.51 |
| C4 | Control | 0.75 |
Step 1: Match T1. The distances are \(|0.22-0.19|=0.03\), \(|0.22-0.35|=0.13\), \(|0.22-0.51|=0.29\), and \(|0.22-0.75|=0.53\). The smallest is 0.03, so assign C1 to T1.
Step 2: Match T2. C1 is no longer available. The remaining distances are \(|0.47-0.35|=0.12\), \(|0.47-0.51|=0.04\), and \(|0.47-0.75|=0.28\). The smallest is 0.04, so assign C3 to T2.
Step 3: Match T3. C1 and C3 have already been assigned. The remaining distances are \(|0.71-0.35|=0.36\) and \(|0.71-0.75|=0.04\). Assign C4 to T3.
The matched pairs are T1–C1, T2–C3, and T3–C4. Control C2, with score 0.35, remains unmatched. Every selected control was the closest one available at its step, and no control was used twice.
When a Treated Unit Has No Available Control
Having fewer controls than treated units means that one-to-one matching without reuse cannot pair every treated unit. The point at which controls are exhausted depends on the specified processing order. It is important to distinguish this situation from a caliper restriction: here, a control may be close enough in score but unavailable because it has already been assigned.
Worked Example: Tracking an Unmatched Treated Unit
Consider three hypothetical treated units processed as A, B, C, and two controls, X and Y. Use the same one-to-one rule: assign the nearest unused control at each step.
| Unit | Status | Estimated propensity score |
|---|---|---|
| A | Treated | 0.26 |
| B | Treated | 0.50 |
| C | Treated | 0.73 |
| X | Control | 0.29 |
| Y | Control | 0.56 |
For A, the distances are \(|0.26-0.29|=0.03\) to X and \(|0.26-0.56|=0.30\) to Y. Assign X to A. For B, X is unavailable, so the only candidate is Y; its distance is \(|0.50-0.56|=0.06\), and Y is assigned to B.
When C is processed, there are no unused controls. C is therefore unmatched. Notice that C would have been 0.17 propensity-score points from Y, since \(|0.73-0.56|=0.17\). That distance does not create a match under the stated rule because Y has already been assigned. The final result is two matched pairs, A–X and B–Y, and one unmatched treated unit, C.
Check the Result, Not Just the Arithmetic
A hand calculation should leave an auditable record of which scores were compared and which controls were still available. A compact distance table is useful when the data set is small; for a larger set, software should implement the specified rule, and the resulting assignments should still be checked. Keep enough score precision to distinguish candidates, and apply the same precision consistently.
- Verify the labels. Confirm which units are treated and which are controls before calculating any distances.
- Recalculate selected distances. For each pair, check the subtraction and absolute value, then check that no available control had a smaller distance.
- Track availability. Mark each assigned control as used immediately. Otherwise, it is easy to assign the same control more than once under a no-reuse rule.
- Report unmatched units. State how many treated units and controls were not paired, and why under the chosen rule.
- Do not equate close scores with exact balance. A small score difference does not guarantee that every measured covariate is balanced in the matched data.
Rounding can change which candidate appears closest, particularly when distances are similar. Use the available score precision for the comparisons and round only when reporting. If two candidates have exactly the same minimum distance, the calculation identifies a tie; the tie-handling rule must be stated rather than silently choosing one. Detailed tie policies are a separate design decision.
Worked Example: Summarizing the Matched Score Gaps
Suppose a hypothetical table contains treated units T1 and T2 with scores 0.34 and 0.66, and controls A, B, C, and D with scores 0.28, 0.37, 0.60, and 0.70. Process T1 first, then T2.
For T1, the distances to A, B, C, and D are respectively \(|0.34-0.28|=0.06\), \(|0.34-0.37|=0.03\), \(|0.34-0.60|=0.26\), and \(|0.34-0.70|=0.36\). Match T1 to B.
For T2, B is unavailable. The distances to the remaining controls are \(|0.66-0.28|=0.38\), \(|0.66-0.60|=0.06\), and \(|0.66-0.70|=0.04\). Match T2 to D. Controls A and C remain unmatched.
The two matched score gaps are 0.03 and 0.04. Their mean is $$ \frac{0.03+0.04}{2}=0.035 $$ propensity-score points. This is a descriptive summary of the selected pairs, not evidence that all covariates are balanced or that a causal effect is unbiased.
What This Calculation Can and Cannot Show
Hand-calculated nearest-neighbor matching is a transparent way to verify a small example or to audit a software output. The distance table shows why a specific available control was selected, while the assignment record shows which units were left out. These details are important because a reported matched sample is not fully described by the word “nearest”; the ordering and reuse rules matter too.
The main alternatives answer different design questions. Matching with replacement allows a control to serve more than one treated unit; the no-reuse rule in these examples does not. Matching on covariates directly, such as with Mahalanobis distance, uses a different distance construction from the one-dimensional propensity-score difference here. Regression adjustment is another approach to estimating treatment contrasts, rather than this particular pairing calculation. These alternatives are not interchangeable, and choosing among them requires attention to the target population, design, and assumptions.
A common mistake is to say, “T1 was matched to the closest control in the whole table, so that control can also be used for T2.” That reasoning conflicts with the no-reuse rule: after the first assignment, the control is no longer available. The correction is to compare each later treated unit only with the controls still eligible under the stated protocol. Another mistake is to conclude that a nearest-neighbor match proves the pair is exchangeable. A small score distance is a feature of the matching calculation; it does not prove the assumptions needed for causal interpretation.
Check Your Understanding
Answer each question using the stated matching rule. Solutions follow the questions.
- A treated unit has score 0.58. Two unused controls have scores 0.51 and 0.62. Which control is nearer, and what is the distance?
- A treated unit has score 0.41. Unused controls have scores 0.37 and 0.46. Calculate both distances and identify the match.
- Two treated units, in order, have scores 0.20 and 0.60. Two controls have scores 0.23 and 0.57. Apply one-to-one greedy matching without reuse and give the pairs.
- Why does a small propensity-score gap not by itself establish that the matched sample is balanced on every covariate?
Solutions. (1) The distances are \(|0.58-0.51|=0.07\) and \(|0.58-0.62|=0.04\), so the control with score 0.62 is nearer, at 0.04 propensity-score points. (2) The distances are \(|0.41-0.37|=0.04\) and \(|0.41-0.46|=0.05\); match to the control with score 0.37. (3) For the first treated unit, the distances are 0.03 to the 0.23 control and 0.37 to the 0.57 control, so assign the 0.23 control. The remaining control has score 0.57, which is then assigned to the second treated unit at distance \(|0.60-0.57|=0.03\). (4) Similar estimated scores do not ensure that every individual covariate has similar values across matched groups. Covariate balance must be assessed directly, and balance diagnostics cannot prove the causal assumptions.