Tutorials › Propensity Score Matching and Instrumental Variables › Fixed-Ratio Nearest-Neighbor Matching

Matching Methods · Tutorial 158 of 699

Fixed-Ratio Nearest-Neighbor Matching

Work through one-to-one and fixed-ratio nearest-neighbor assignments, including the arithmetic, capacity limits, and diagnostics for incomplete or poorly supported matches.

Intermediate 10 min read

What You'll Learn

  • Define a fixed matching ratio and a complete matched set.
  • Assign one or multiple nearest controls to each treated unit without replacement.
  • Calculate score distances and construct matched sets step by step.
  • Determine how many complete sets the available controls can support.
  • Diagnose incomplete or poor matches without confusing matching with causal identification.
  • Compare fixed-ratio matching with one-to-one matching and matching with replacement.

What a Fixed Matching Ratio Specifies

Nearest-neighbor matching assigns comparison units to treated units according to a chosen distance. In propensity score matching, that distance is often the absolute difference between their estimated propensity scores. A fixed ratio specifies how many controls each matched treated unit must receive. For example, a 1:1 ratio assigns one control to each treated unit; a 1:2 ratio assigns two controls to each treated unit.

The ratio describes the structure of the matched sets, not a guarantee that every treated unit can be matched. In this tutorial, the procedure is without replacement: once a control is assigned to a set, it is unavailable for another set. This convention makes control availability a direct constraint on how many complete sets can be formed. A different design, such as matching with replacement, allows a control to appear in more than one set and must be specified separately.

Definition: In fixed-ratio 1:\(k\) nearest-neighbor matching without replacement, each matched treated unit is assigned exactly \(k\) distinct controls. The controls are selected from those still available, in order of increasing distance from that treated unit, using a specified distance measure. A matched set consists of one treated unit and its \(k\) assigned controls.

Let \(T_i=1\) indicate a treated unit and \(T_i=0\) a control. Write \(\hat e_i\) for unit \(i\)'s estimated propensity score. When matching on the propensity score itself, the distance between treated unit \(i\) and control \(j\) is \(d(i,j)=|\hat e_i-\hat e_j|\). The nearest available control has the smallest such distance. For 1:\(k\) matching, select the \(k\) nearest available controls for each treated unit, following the stated assignment order.

The treated-unit order and distance measure are part of the procedure and should be reported. The examples below use the displayed order and have no tied distances at a selection boundary. How to resolve ties is a separate design decision. No caliper is imposed here: a nearest control is selected if available, even if its distance is large. Consequently, being nearest does not itself mean being sufficiently similar.

How Many Complete Sets Can Be Formed?

Suppose there are \(N_1\) treated units and \(N_0\) controls. Each complete 1:\(k\) set consumes \(k\) distinct controls. If \(m\) treated units are matched, they require \(km\) controls, so \(km\leq N_0\). Therefore \(m\leq\lfloor N_0/k\rfloor\), and no more than \(\min(N_1,\lfloor N_0/k\rfloor)\) complete sets can be formed on the basis of counts alone.

$$ m \leq \min\left(N_1,\left\lfloor \frac{N_0}{k}\right\rfloor\right) $$

This is a capacity bound, not a promise that the algorithm will find suitable matches. It also shows why the ratio matters: increasing \(k\) uses more controls per treated unit and can reduce the number of treated units that can be retained. If every treated unit must receive a complete set, a necessary count condition is \(N_0\geq kN_1\). This condition says nothing about whether the available controls have close scores.

Worked Example: One-to-One Matching Without Replacement

Suppose three treated units have estimated propensity scores \(0.42\), \(0.65\), and \(0.81\). Five controls have scores \(0.39\), \(0.47\), \(0.62\), \(0.70\), and \(0.84\), labelled C1 through C5 in that order. Match treated units T1, T2, and T3 in that order using 1:1 matching without replacement.

For T1, whose score is \(0.42\), the distances to C1–C5 are \(0.03, 0.05, 0.20, 0.28,\) and \(0.42\). The nearest control is C1, so assign T1 to C1.

For T2, whose score is \(0.65\), C1 is no longer available. The distances to the remaining controls C2–C5 are \(0.18, 0.03, 0.05,\) and \(0.19\). The nearest available control is C3, with distance \(0.03\).

For T3, whose score is \(0.81\), the remaining controls are C2, C4, and C5. Their distances are \(0.34, 0.11,\) and \(0.03\), respectively. Assign T3 to C5. The resulting sets are (T1, C1), (T2, C3), and (T3, C5). Each set contains one treated unit and one distinct control.

There were enough controls to match all three treated units because \(N_0=5\) and \(kN_1=1(3)=3\). Two controls remain unused. The example illustrates that unused controls are compatible with fixed-ratio matching: the design requires one control per matched treated unit, not that every control be selected.

Constructing a Higher Fixed Ratio

For a 1:\(k\) ratio, apply the distance rule to the available controls and take the \(k\) closest for each treated unit. Remove all \(k\) assigned controls before proceeding to the next treated unit. The calculation is repeated for each treated unit in the stated order. A set is complete only if all \(k\) controls are available.

1
Specify the design.
Record the ratio, distance measure, whether controls may be reused, and the order in which treated units are processed.
2
Calculate distances.
For the current treated unit, calculate its distance to every control still available.
3
Assign the required number.
Select the \(k\) available controls with the smallest distances and form one matched set.
4
Update availability and continue.
Mark the selected controls unavailable, then repeat for the next treated unit. Record any treated unit that cannot receive a complete set.

Worked Example: Two Controls per Treated Unit

Three treated units A, B, and C have scores \(0.30\), \(0.55\), and \(0.78\), and are processed in that order. Controls C1–C7 have scores \(0.28\), \(0.34\), \(0.49\), \(0.58\), \(0.73\), \(0.82\), and \(0.90\). Use 1:2 matching without replacement.

For A, the distances to C1–C7 are \(0.02, 0.04, 0.19, 0.28, 0.43, 0.52,\) and \(0.60\). The two smallest are \(0.02\) and \(0.04\), so A is matched to C1 and C2. Those controls are removed from the available pool.

For B, the available controls are C3–C7. The distances are \(0.06, 0.03, 0.18, 0.27,\) and \(0.35\). The two smallest are \(0.03\) for C4 and \(0.06\) for C3, so B is matched to C4 and C3.

For C, the remaining controls are C5, C6, and C7. The distances are \(0.05, 0.04,\) and \(0.12\). The two nearest are C6 and C5. The final matched sets are (A, C1, C2), (B, C4, C3), and (C, C6, C5). C7 remains unused. All three treated units receive exactly two distinct controls.

There are seven controls, so the count bound is \(\min(3,\lfloor 7/2\rfloor)=3\) complete sets. The observed assignment reaches that bound. Note that for B and C, listing controls by distance would give C4 before C3 and C6 before C5; the order of controls within a set does not change which units belong to it.

When the Control Pool Is Too Small

If fewer than \(k\) controls remain for a treated unit, that unit cannot form a complete 1:\(k\) set under matching without replacement. A fixed-ratio design does not silently create a smaller set for that unit: doing so would change the ratio. The analyst must report the incomplete assignment and specify how the design handles it, for example by leaving that treated unit unmatched. Which units are retained can depend on the stated processing order.

The count bound can identify a problem before any distances are calculated. It does not, however, show which treated units will be matched, because that depends on the assignment procedure. Nor does a sufficient number of controls guarantee that all selected controls will be close in score.

Worked Example: A Two-Control Ratio with Insufficient Capacity

Three treated units T1, T2, and T3 have scores \(0.20\), \(0.48\), and \(0.77\). Five controls have scores \(0.18\), \(0.25\), \(0.45\), \(0.53\), and \(0.80\). Process the treated units in the displayed order using 1:2 matching without replacement.

For T1, the distances to the five controls are \(0.02, 0.05, 0.25, 0.33,\) and \(0.60\). Assign the two nearest, with distances \(0.02\) and \(0.05\): the controls with scores \(0.18\) and \(0.25\).

For T2, the three remaining controls have scores \(0.45\), \(0.53\), and \(0.80\). Their distances from \(0.48\) are \(0.03\), \(0.05\), and \(0.32\). Assign the first two controls, with scores \(0.45\) and \(0.53\).

No controls remain for T3, so T3 cannot receive a complete set. The capacity bound confirms the result: \(\min(3,\lfloor 5/2\rfloor)=2\). Thus, at most two complete sets can be formed, leaving one treated unit unmatched under this processing plan. The distance calculations do not override the control-count constraint.

Checking the Result and Understanding Its Limits

After matching, verify the structure mechanically: each retained treated unit should occur in one set, each set should contain exactly \(k\) controls, and no control should appear in more than one set under the without-replacement design. Recalculate the selected distances to ensure that the assigned controls were the nearest available controls under the specified rule. Also report the number of unmatched treated units and unused controls.

Then examine whether the matches are substantively credible. A selected control can be the nearest available unit and still be far away in score, especially when the control pool is limited or the score distributions have little overlap. Inspect score differences within sets and covariate balance after matching; a fixed ratio alone does not establish balance. If some treated units have no close controls, a nearest-neighbor assignment without a distance restriction can conceal that lack of support by assigning distant controls.

Matching is a design procedure, not by itself a guarantee of causal identification. A causal interpretation still depends on the relevant causal assumptions, including conditional exchangeability and adequate overlap, as well as appropriate outcome analysis. The introductory material on causal inference gives the broader framework; the key point here is that the act of assigning nearest neighbors does not make those assumptions true.

A fixed ratio also represents a practical trade-off. Matching more controls to each treated unit can provide more comparison observations, but it consumes the control pool more quickly and may require using less similar controls. One-to-one matching uses fewer controls per set and can be feasible with a smaller control pool. Matching with replacement permits reuse of controls, avoiding the same depletion constraint, but a repeatedly selected control then contributes to multiple matched sets. These designs are not interchangeable: the chosen ratio and reuse rule determine the matched sample and should be stated explicitly.

Common pitfall: “There are at least \(k\) controls for each treated unit overall, so every treated unit can get a 1:\(k\) set.” This ignores that matching without replacement removes controls as sets are formed. The relevant condition for matching all treated units by count is \(N_0\geq kN_1\); even that condition is not sufficient to guarantee close matches. Check both capacity and the actual distances.

Check Your Understanding

Try each question, then check the solution immediately below it.

  1. There are four treated units and ten controls. What is the maximum possible number of complete sets for 1:2 matching without replacement? Solution: \(\min(4,\lfloor 10/2\rfloor)=4\), so the control count permits all four treated units to be matched.
  2. A treated unit has score \(0.60\). Three available controls have scores \(0.56\), \(0.64\), and \(0.75\). Which two are selected under 1:2 nearest-neighbor matching on the score? Solution: The distances are \(0.04\), \(0.04\), and \(0.15\). The first two controls are the nearest, with distances \(0.04\) each. This example has a tie at the selection boundary, so a complete assignment requires a stated tie rule.
  3. There are seven controls and five treated units. What is the maximum number of complete sets under 1:3 matching without replacement? Solution: \(\min(5,\lfloor 7/3\rfloor)=2\). Two sets use six controls, leaving one control; three complete sets would require nine.
  4. In one sentence, why does choosing the nearest available controls not guarantee a good match? Solution: The nearest available controls can still be far away in score, and nearest-neighbor selection alone does not guarantee covariate balance or causal identification.
Clinical Biostats