Matching removes confounding by design, but it introduces one nuisance parameter per matched set, and those parameters do not go away as the sample grows – there is always one more per new set. Ordinary logistic regression therefore returns an odds ratio biased away from one, badly so for 1:1 pairs. Conditioning on the number of cases in each set cancels the nuisance parameters exactly, leaving a likelihood in the exposure effect alone.
Arguments
- cases
Per-observation case indicator, 1 for a case, 0 otherwise.
- controls
Optional control indicator; if supplied it must be
1 - cases, and it is checked.- matching_id
Matched-set label per observation, one case per set.
- exposure
Exposure value per observation; binary or continuous.
- level
Confidence level.
- max_iter
Newton steps.
- tol
Convergence tolerance on the score.
Details
Formula: for a set with one case, \(L_s(beta) = exp(beta x_case) / sum_j exp(beta x_j)\); the maximum is found by Newton-Raphson – Breslow and Day (1980), Chapter 7.
