Skip to contents

Performs greedy nearest-neighbor matching on the logit of the propensity score within a user-specified standard deviation caliper.

Usage

match_nearest_neighbor(
  df,
  propensity_score_col = "propensity_score",
  treatment_col = "treatment",
  caliper = 0.2,
  ratio = 1L
)

Arguments

df

Data frame containing propensity scores and treatment indicators.

propensity_score_col

Column name holding estimated propensity scores.

treatment_col

Binary indicator column (1 = target/treated, 0 = comparator/control).

caliper

Caliper distance in units of SD of logit(PS) (default 0.2).

ratio

Number of comparator subjects to match per target subject (default 1L).

Value

A list with matched_data (subset of matched rows) and pairs (pairing ledger).