Chapter 13 · Regression models

How can an observational study imitate randomisation?

Mantel-Haenszel stratification, propensity score matching, weighting and balance checks.

Read first: Bias, confounding and validity, Study designs

The problem first

You are a second-year Pulmonary Medicine resident. Your thesis uses ICU records of 1000 patients with pneumonia. 500 received a new drug and 500 did not. Death within 30 days was 25.0% with the drug and 13.6% without, odds ratio 2.12, p < 0.001. Your draft concludes that the drug increases mortality.

At the departmental review, your guide reads the results table and asks one question.

“Were the patients who received the drug as sick as the patients who did not?”

Start here

Why can't you compare treated and untreated patients directly?

In routine practice doctors choose who gets a treatment, and they choose for reasons. If the same reasons also change the outcome, the treated and untreated groups differ before any treatment is given.

Severe illnessGiven the drugDied within 30 daysdoctors give the drugto sicker patientssicker patientsdie more oftenthe effect you wantThe back path through severity links the drug with death even if the drug does nothing.
Made-up teaching example. When the reason for giving a treatment (the indication, here severe illness) also affects the outcome, the comparison is distorted. This is confounding by indication. In a randomised trial chance decides who is treated, so severity is balanced between groups. In records, 80% of the treated patients and 20% of the untreated patients had severe illness.

A confounder is linked to the treatment and, separately, to the outcome. The bias and validity chapter introduces confounding and the Mantel-Haenszel estimate. This chapter shows how an observational study can compare like with like: first by stratification, then with a propensity score that handles many confounders at once. Austin (2011) describes the propensity score as a way to design and analyse an observational study “so that it mimics some of the particular characteristics of a randomized controlled trial”.

Stratification

How does comparing like with like remove confounding?

Split the patients by the confounder, so that within each group (stratum) the treated and untreated patients have the same severity. Compare inside each stratum, then combine the stratum results into one pooled estimate.

given the drugnot given25%13.6%All patientsOR 2.1230%40%Severe illnessOR 0.645%7%Mild illnessOR 0.70
Made-up teaching data, the thesis in the problem above. Overall the drug looks harmful (OR 2.12). Among severely ill patients, death was lower with the drug (30% against 40%), and among mildly ill patients too (5% against 7%). The crude result reversed because most treated patients were severely ill. The Mantel-Haenszel odds ratio pools the two strata: 0.65 (95% CI 0.43 to 0.99).

ORMH = Σ (ai × di ÷ ni) ÷ Σ (bi × ci ÷ ni)

a, b
treated patients who died, and who survived, in stratum i
c, d
untreated patients who died, and who survived, in stratum i
n
all patients in stratum i
Σ
add over all strata

Each stratum contributes in proportion to its size, so a small stratum does not dominate. Before pooling, check that the stratum odds ratios are similar (here 0.64 and 0.70, Breslow-Day test p = 0.88). If they differ clearly, the confounder is modifying the effect, and you report each stratum instead of one pooled number. The full working is in the worked example.

Where stratification stops working

  • Each extra confounder multiplies the number of strata. Sex × 3 severity grades × 4 age bands × diabetes gives 48 strata, and many contain few or no treated or untreated patients.
  • A continuous confounder must be cut into categories, and patients inside one category still differ.
  • Only the confounders you stratify on are handled.

The propensity score

How can many confounders become one number?

Instead of stratifying on every characteristic, estimate for each patient the probability that a patient with those characteristics receives the treatment. Patients with the same probability can then be compared, whatever combination of characteristics produced it.

Age 67 yearsSeverity score 3Diabetes: yesSmoker: noCreatinine 1.4 mg/dLlogistic regressiontreatment on characteristicsPS = 0.62probability ofreceiving the drug00.250.50.751treateduntreatedsimilar scores: a similar mix of measured characteristics
Made-up teaching example. The propensity score is “the probability of treatment assignment conditional on observed baseline characteristics” (Austin, 2011, following Rosenbaum and Rubin, 1983). In practice it is most often estimated by logistic regression of treatment status on the baseline characteristics, and the estimated score is each patient's predicted probability of treatment.

The score is a balancing score: among patients with the same propensity score, the distribution of the measured baseline characteristics is similar in treated and untreated patients (Austin, 2011). A treated and an untreated patient with scores of 0.62 may differ in age or diabetes, but across many such pairs the measured characteristics balance out, as they would after randomisation.

Two conditions must hold

  1. No unmeasured confounders: every variable that affects both treatment and outcome has been measured and put into the model. This is the main assumption, and the data cannot prove it.
  2. Positivity: every patient has a probability of receiving each treatment that is above 0 and below 1 (see below).

Build the model from characteristics measured before treatment was decided. A variable changed by the treatment is not a confounder and does not belong in the score.

Methods

What can you do with the propensity score?

Austin (2011) describes four methods: matching on the score, stratification on the score, inverse probability of treatment weighting, and covariate adjustment using the score.

1. Matchingpairs with similar scores; unmatched dropped2. Stratificationcompare within each fifth, then pool3. Weighting (IPTW)weight = 1 ÷ probability of treatment received4. Covariate adjustmentthe score is a covariate in the outcome modelPS 0.8 → 1.25PS 0.2 → 5treatedpatientsdeath ~ drug + PSregression of the outcome ontreatment and the estimated score
Made-up teaching example. The first three methods use the score to build a comparable sample before the outcome is analysed. Covariate adjustment puts the score directly into the outcome model.

1. Matching

Each treated patient is paired with an untreated patient whose score is close. Austin (2011) describes the choices: nearest-neighbour matching picks the untreated patient with the closest score, and nearest-neighbour matching within a caliper also requires the difference to be below a set maximum. Matching without replacement uses each untreated patient once. A treated patient with no untreated patient inside the caliper is excluded. Austin (2011) recommends matching on the logit of the score with a caliper of 0.2 of its standard deviation. Matching estimates the effect in the treated patients (the ATT).

treateduntreatedcaliperno untreated patient withinthe caliper: left unmatched−3−2−10123logit of the propensity score
Made-up teaching example. The caliper is the largest difference in score allowed within a pair. The treated patient at 2.6 is excluded from the matched sample because the nearest untreated patient is 1.0 away.

2. Stratification on the score

Patients are ranked by the score and divided into five equal groups (quintiles). Rosenbaum and Rubin (1984) stated that stratifying on the quintiles of the propensity score removes approximately 90% of the bias due to measured confounders when estimating a linear treatment effect, extending Cochran's (1968) result for a single confounder (Austin, 2011).

3. Inverse probability of treatment weighting (IPTW)

Each patient is weighted by the inverse of the probability of the treatment they actually received: 1 ÷ e for a treated patient and 1 ÷ (1 − e) for an untreated patient, where e is the score. A treated patient with a score of 0.2 was unusual for being treated and gets weight 5. An untreated patient with a score of 0.2 gets 1.25. The weighted sample estimates the effect in the whole population (the ATE). Weights of 1 for treated and e ÷ (1 − e) for untreated patients estimate the ATT instead (Austin and Stuart, 2015). Very large weights make the estimate unstable, and stabilised or truncated weights are options.

4. Covariate adjustment using the score

The outcome is regressed on treatment and the estimated score, with a linear model for a continuous outcome or a logistic model for a yes/no outcome (Austin, 2011). Unlike the other three methods, it does not separate the design of the comparison from the analysis of the outcome.

Interactive

Change how strongly severity decides treatment, and compare the crude, stratified, matched and weighted estimates

All four estimates use the same patients. They differ in how much of the difference between treated and untreated patients they remove.

Try this: set the true effect to "no effect" and move the confounding from "none" to "strong". The crude risk ratio rises above 2 although the drug does nothing, while the matched and weighted estimates stay much closer to 1.

Teaching simulation with made-up data: 2000 patients with pneumonia. Sicker and older patients are more likely to be given the drug, and sicker and older patients are more likely to die. The Mantel-Haenszel estimate stratifies on severity alone, in fifths. The propensity score (PS) comes from a logistic regression on severity and age.

moderate

None = the drug is given at random

True effect of the drug
Samplenumber 2
true 0.70Crude1.40MH, severity fifths0.83PS matched0.74PS weighted (IPTW)0.680.30.50.711.523
0.1Severitybefore0.94matched0.09weighted0.00Agebefore0.38matched0.06weighted0.0000.511.5

628 given the drug, 1372 not · death 22.9% vs 16.4% · 554 matched pairs, 74 treated patients left unmatched (caliper 0.232 on the logit scale)

The crude risk ratio is 1.40 against a true 0.70, because the patients given the drug were sicker and older. Stratifying on severity alone gives 0.83: age still differs, and patients within one fifth of severity still differ. Matching (0.74) and weighting (0.68) on a score built from both variables come closer.

Every method here adjusts only for severity and age, which were measured. Add an unmeasured cause of both treatment and death and none of them would remove it.

Balance

How do you know the propensity score worked?

Compare the baseline characteristics of treated and untreated patients after matching or weighting. If the score did its job, they look alike. The measure used is the standardised mean difference, not a p-value.

SMD = (mean₁ − mean₀) ÷ √[(SD₁² + SD₀²) ÷ 2]

SMD
standardised mean difference: the gap between groups in units of the pooled standard deviation
1, 0
treated and untreated patients
Yes/no variable
(p₁ − p₀) ÷ √{[p₁(1 − p₁) + p₀(1 − p₀)] ÷ 2}, where p is the proportion
Threshold
there is no universally agreed cut-off. An SMD below 0.1 has been taken to indicate a negligible difference (Austin, 2011)
0.1Matched sample40 patients per groupp = 0.18Registry5000 patients per groupp = 0.01200.10.20.30.4standardised mean difference in age
Made-up teaching example, p-values from a two-sample t-test. Austin (2011) gives two reasons against significance tests for balance. First, p-values depend on sample size: a matched sample is smaller than the original, so a real imbalance can be “not significant”, and in a large sample a trivial difference becomes significant. Second, balance is a property of this particular sample, so a test that refers to a wider population is inappropriate. The SMD is not influenced by sample size.
  • Report the SMD for every covariate before and after matching or weighting, in a table or a dot plot (love.plot() in the cobalt package draws one).
  • For continuous covariates also compare variances and distributions, not only means (Austin, 2009).
  • The c-statistic of the propensity score model “provides no information as to whether the propensity score model has been correctly specified” (Austin, 2011). A score that predicts treatment very well is not the aim. Balance is.
  • If balance is poor, change the score model (add interactions or non-linear terms) and check again, before looking at the outcome.

Positivity

What if some patients could only ever have received one treatment?

A comparison needs patients in both groups who resemble each other. If every patient with a certain profile was treated, there is no untreated patient to compare them with, and no method can create one.

Rosenbaum and Rubin's conditions include that every subject has a non-zero probability of receiving either treatment, written 0 < P(treatment | characteristics) < 1 (Austin, 2011). This is positivity. In practice, look at the distribution of the score in the two groups. Where the distributions do not overlap:

  • matching leaves many treated patients without a partner, and the matched result no longer describes all treated patients;
  • weighting gives very large weights to the few patients in the sparse region, and the estimate depends heavily on them (Austin and Stuart, 2015);

When overlap is sparse, Austin (2011) describes two choices: restrict the analysis to the treated and untreated patients with similar covariate patterns, or stop the analysis. If you restrict, state clearly which patients the result applies to.

Interactive

Make treatment depend more strongly on severity and watch the two score distributions separate

The stronger the link between patient characteristics and treatment, the fewer patients have comparable partners in the other group.

Try this: move the strength from "moderate" to "almost decisive". Treated and untreated patients pile up at opposite ends of the score, more treated patients find no match, and single patients receive very large weights.

Teaching simulation with made-up data, the same 2000 pneumonia patients as above. Each bar counts patients with an estimated propensity score in a band of width 0.05.

moderate
given the drugnot given the drug00.250.50.751estimated propensity score (shaded: range where both groups have patients)
What to checkValueWhat it shows
Scores shared by both groups0.041 to 0.90968 patients lie outside this range and have no comparable patient in the other group
Treated patients with no match within the caliper74 of 628Matching drops them, so the matched result no longer describes all treated patients
Largest weight24.3One patient counts as 24.3 patients in the weighted analysis
Effective sample size, treated350 of 628Uneven weights give the precision of a smaller group
Effective sample size, untreated1152 of 1372(Σw)² ÷ Σw²

Unmeasured confounding

What about confounders nobody measured?

Randomisation balances characteristics you measured and characteristics you did not. A propensity score balances only what went into it. The remaining question is how strong an unmeasured confounder would have to be to change the conclusion.

Measuredseverity, ageNot measuredfor example, frailtyGiven the drugDiedbalanced by the PSRR with treatmentRRwithdeathobserved association, adjusted only for what was measured
Made-up teaching example. The E-value is “the minimum strength of association, on the risk ratio scale, that an unmeasured confounder would need to have with both the treatment and the outcome to fully explain away a specific treatment-outcome association, conditional on the measured covariates” (VanderWeele and Ding, 2017).

E-value = RR + √[RR × (RR − 1)]

RR
the observed risk ratio. If it is below 1, use 1 ÷ RR first
Rare outcome
an odds or hazard ratio with an outcome under 15% is used as a risk ratio (EValue package)
Common OR
RR ≈ √OR
Common HR
RR ≈ (1 − 0.5^√HR) ÷ (1 − 0.5^√(1/HR))
CI limit
repeat for the limit closer to 1. If the interval already includes 1, its E-value is 1

Example: an observed RR of 2 gives an E-value of 2 + √(2 × 1) = 3.41 (VanderWeele, 2022). An unmeasured confounder associated with both treatment and outcome by a risk ratio of 3.41 each could explain the association away. Weaker confounding could not. VanderWeele and Ding propose that observational studies intended to support causal conclusions report the E-value for the estimate and for the confidence limit closest to the null.

The E-value comes from a bounding factor (Ding and VanderWeele, 2016): a confounder with risk ratio RREU with the exposure and RRUD with the outcome can shift the risk ratio by at most RREU × RRUD ÷ (RREU + RRUD − 1). For example, (2, 2) gives 2 × 2 ÷ 3 = 1.33. The E-value is the value that both would need, if equal, to make the bounding factor as large as the observed risk ratio.

A large E-value means that considerable unmeasured confounding would be needed to explain the result. It does not show that such confounding is absent. Judge it against what is known about the confounders that were not measured.

Interactive

Enter a published estimate and its confidence limit, and see how strong an unmeasured confounder would need to be

The E-value for the confidence limit tells you how strong confounding would need to be before the result stops excluding no effect.

Try this: the starting values are the 30-day mortality result of the BMJ study below (HR 0.73, upper 95% limit 0.81). Move the confidence limit to 1.05 and watch its E-value fall to 1.

What the study reported
0.73
0.81

For an estimate below 1 this is the upper limit

2.08E-value for the estimate
1.77E-value for the confidence limit

risk ratio used 0.73 → inverted 1.37 · E = RR + √(RR × (RR − 1)) = 2.08

An unmeasured confounder would need a risk ratio of at least 2.08 with both the treatment and the outcome, beyond the measured covariates, to move the estimate to 1. To move the upper confidence limit to 1, a risk ratio of at least 1.77 with both would be enough.

E-value 2.08above the curve: strong enough to explain it away1122334455667788risk ratio linking the confounder with treatment↑ risk ratio linking the confounder with the outcome

Curve: combinations whose bounding factor, RREU × RRUD ÷ (RREU + RRUD − 1), equals the observed risk ratio 1.37 (Ding and VanderWeele, 2016). Pairs above the curve are strong enough to explain the estimate away. Pairs below it are too weak. The E-value is the point on the curve where both are equal.

Decide

Which adjustment method fits your study?

Answer the questions in order.

How many confounders must you adjust for?

Which method: all possible answers
  • Stratification with the Mantel-Haenszel estimate: Estimate the association within each stratum, check that the stratum estimates are similar, then pool them. Each extra confounder multiplies the number of strata.
  • Propensity score matching: Nearest-neighbour matching on the logit of the score with a caliper of 0.2 SD (Austin, 2011). Check standardised differences in the matched sample and analyse the pairs as matched.
  • Weighting for the ATT: Treated patients get weight 1 and untreated patients get e ÷ (1 − e), where e is the propensity score (Austin and Stuart, 2015). No treated patient is dropped.
  • Inverse probability of treatment weighting (IPTW): Weights 1 ÷ e for treated and 1 ÷ (1 − e) for untreated patients. Check weighted standardised differences and the largest weights.
  • A positivity problem comes first: Patients who could only ever receive one treatment have no comparable patients. Restrict the analysis to the range where both groups have patients and say so, or reconsider whether the question can be answered (Austin, 2011).

Comparison

Which of these ideas do residents mix up?

Randomisation or a propensity score?

FeatureRandomisationPropensity score
Who decides treatmentChanceClinicians and patients; the score estimates how they decided
Measured characteristicsBalanced on averageBalanced if the score model is adequate (check the SMDs)
Unmeasured characteristicsBalanced on averageNot balanced. Assumed to be absent
Known scoreYes, fixed by the design (for example 0.5)No, estimated from the data
Sensitivity analysis for unmeasured confoundingNot needed for thisNeeded, for example an E-value

Matching or weighting?

FeaturePropensity score matchingInverse probability weighting
Patients usedMatched pairs only. Unmatched patients are droppedEveryone, with weights
Usual estimandEffect in the treated (ATT)Effect in the whole population (ATE) with weights 1/e and 1/(1 − e)
Main riskMany treated patients unmatched when overlap is poorVery large weights when scores are near 0 or 1
Balance checkSMD in the matched sampleWeighted SMD in the weighted sample (Austin and Stuart, 2015)
R packageMatchItWeightIt

Standardised difference or p-value for balance?

FeatureStandardised mean differencep-value
MeasuresSize of the imbalance in SD unitsSurprise if the populations did not differ
Depends on sample sizeNoYes
In a small matched sampleShows a real imbalanceOften "not significant" despite imbalance
In a large databaseShows that a difference is trivialOften "significant" for trivial differences
Use for balanceYes, commonly below 0.1No, discouraged (Austin, 2011)

The formula

Worked example: stratified odds ratio, balance, weights and E-value

Made-up teaching data: the pneumonia thesis from the problem at the top. 1000 patients, 500 given the drug and 500 not. Rows: treated, untreated. Columns: died, survived.

StratumTreated: died (a)Treated: survived (b)Untreated: died (c)Untreated: survived (d)nOR
Severe illness12028040605000.64
Mild illness595283725000.70
All patients1253756843210002.12

Step 1: crude and stratum odds ratios

  1. Crude OR = (125 × 432) ÷ (375 × 68) = 54000 ÷ 25500 = 2.12 (95% CI 1.53 to 2.93).
  2. Severe: (120 × 60) ÷ (280 × 40) = 7200 ÷ 11200 = 0.64. Mild: (5 × 372) ÷ (95 × 28) = 1860 ÷ 2660 = 0.70.
  3. Breslow-Day test of equal odds ratios: χ² = 0.02, p = 0.88. The stratum odds ratios are similar, so pooling is reasonable.

Step 2: Mantel-Haenszel pooled odds ratio

  1. Severe: a × d ÷ n = 120 × 60 ÷ 500 = 14.40 and b × c ÷ n = 280 × 40 ÷ 500 = 22.40.
  2. Mild: 5 × 372 ÷ 500 = 3.72 and 95 × 28 ÷ 500 = 5.32.
  3. ORMH = (14.40 + 3.72) ÷ (22.40 + 5.32) = 18.12 ÷ 27.72 = 0.654.
  4. 95% CI 0.43 to 0.99. Cochran-Mantel-Haenszel test χ² = 4.12, p = 0.042.

Crude OR 2.12 → ORMH 0.65

Step 3: how unbalanced was severity?

Severe illness: 80% of treated and 20% of untreated patients. SMD = (0.80 − 0.20) ÷ √[(0.80 × 0.20 + 0.20 × 0.80) ÷ 2] = 0.60 ÷ 0.40 = 1.50, far above 0.1.

Step 4: inverse probability weights

A treated patient with a propensity score of 0.8 gets weight 1 ÷ 0.8 = 1.25. An untreated patient with the same score gets 1 ÷ 0.2 = 5. The untreated patient resembles the treated majority, so counts for more in the untreated group.

Step 5: E-value

Suppose a matched analysis gave RR 0.70 (95% CI 0.55 to 0.89).

  1. RR below 1, so invert: 1 ÷ 0.70 = 1.429. E-value = 1.429 + √(1.429 × 0.429) = 2.21.
  2. Confidence limit closer to 1 is 0.89: 1 ÷ 0.89 = 1.124. E-value = 1.124 + √(1.124 × 0.124) = 1.50.

Odds ratios, confidence intervals and tests computed in Python with statsmodels (Table2x2, StratifiedTable). The drug, the patients and the numbers are invented for teaching.

In a real paper

How are propensity score methods reported in real studies?

Open-access paper · CC BY-NC 4.0

Rentsch CT, Beckman JA, Tomlinson L, Gellad WF, Alcorn C, Kidwai-Khan F, et al. Early initiation of prophylactic anticoagulation for prevention of coronavirus disease 2019 mortality in patients admitted to hospital in the United States: cohort study. BMJ. 2021;372:n311.

The study: A nationwide cohort of 4297 patients receiving care in the US Department of Veterans Affairs who were admitted to hospital with covid-19 from 1 March to 31 July 2020, without a history of anticoagulation. 3627 (84.4%) received prophylactic anticoagulation within 24 hours. Clinicians chose who received it, so treated and untreated patients differed, and the authors used inverse probability of treatment weighting.

What the authors wrote
“Using inverse probability of treatment weighted analyses, the cumulative incidence of mortality at 30 days was 14.3% (95% confidence interval 13.1% to 15.5%) among those who received prophylactic anticoagulation and 18.7% (15.1% to 22.9%) among those who did not.”
In plain words

Each patient was weighted by the inverse of the probability of the treatment they actually received, estimated from their measured characteristics. In that weighted sample the two groups resembled each other on those characteristics. Deaths within 30 days were then 14.3% with prophylactic anticoagulation and 18.7% without. The authors chose the average treatment effect (ATE) because patients with contraindications had been excluded, so all included patients were assumed eligible for anticoagulation.

ReportedValueWhat it means
Hazard ratio, 30-day mortality0.73 (95% CI 0.66 to 0.81)A 27% lower hazard of death in the weighted comparison
Balance criterionSMD 0.2 or less; most 0.1 or lessThe stated threshold is looser than the 0.1 often used
E-value, confidence limit1.77 (30-day), 1.92 (inpatient), 1.46 (therapeutic anticoagulation)Strength of unmeasured confounding needed to move the upper limit to 1
Sensitivity analysesScores capped at the 1st/99th and 5th/95th centiles; stabilized weightsChecks that patients with extreme scores or weights did not drive the result
Check these when you read it
  • Recompute an E-value: 1 ÷ 0.81 = 1.235, and 1.235 + √(1.235 × 0.235) = 1.77, the published value. The hazard ratio was used directly as a risk ratio. With the common-outcome conversion for a hazard ratio, the E-value for 0.81 would be 1.58.
  • The balance threshold was SMD 0.2 or less. Look at the supplementary balance figure to see which covariates lay between 0.1 and 0.2.
  • Were the variables in the weighting model all measured before anticoagulation was started?
  • Only measured confounders are handled. Ask what might have influenced both the decision to anticoagulate and survival but was not recorded.
Open-access paper · CC BY 4.0

Pérez-Belmonte LM, Torres-Peña JD, López-Carmona MD, Ayala-Gutiérrez MM, Fuentes-Jiménez F, Jorge Huerta L, et al. Mortality and other adverse outcomes in patients with type 2 diabetes mellitus admitted for COVID-19 in association with glucose-lowering drugs: a nationwide cohort study. BMC Med. 2020;18(1):359.

The study: Patients with type 2 diabetes admitted for COVID-19 in the Spanish SEMI-COVID-19 Registry. Each user of one glucose-lowering drug was matched 1:1 by propensity score with a user of other glucose-lowering drugs, and outcomes such as in-hospital death were compared. The drug a patient took at home depended on their characteristics, which also affect COVID-19 outcomes.

What the authors wrote
“In order to match each patient in one of these groups with a patient of another group receiving other glucose-lowering drugs in a 1:1 manner, propensity scores using nearest neighbor matching with a caliper of 0.1 and a greedy matching algorithm were used.”
In plain words

For every user of a given drug, the authors chose one user of other drugs whose propensity score was closest, and accepted the pair only if the scores differed by no more than the caliper of 0.1. In greedy matching, treated patients are taken one at a time and each is given the closest untreated patient still available (Austin, 2011). Patients without a partner inside the caliper were left out.

ReportedValueWhat it means
Patients in the registry2666Starting population with type 2 diabetes
Matched users249 metformin, 105 DPP-4 inhibitors, 129 insulin, 34 metformin/SGLT-2 inhibitorNumbers on each drug after matching
Balance criterionSMD > 10% counted as imbalance; after matching SMD ≤ 0.1Balance judged by standardised differences, not p-values
Analysis of the matched dataConditional logit and mixed effect models (n ≥ 100); McNemar test (n < 100)Methods for paired data, because the matched patients form pairs
Metformin and in-hospital death, univariate modelOR 0.73 (95% CI 0.58 to 0.90)Before matching; no association remained after matching
Check these when you read it
  • The caliper is given as 0.1 without units. Was it 0.1 on the propensity score scale, or 0.1 standard deviations of the logit? The two are very different.
  • Some matched groups were small (34 patients on metformin with an SGLT-2 inhibitor). A lack of association in a small matched group may reflect imprecision. The authors note this.
  • The authors state that unmeasured confounding cannot be excluded. No E-value was reported.
  • Did the model include only characteristics present before admission?

How to run it

How do you run propensity score analyses?

Estimating the score is ordinary logistic regression. Matching, weighting, balance tables and E-values are easiest in R, with packages written for the purpose.

R

# 1. Matching: nearest neighbour on the logit of the score, caliper 0.2 SD
library(MatchIt)
m.out <- matchit(drug ~ severity + age + diabetes + creatinine, data = icu,
                 method = "nearest", distance = "glm", link = "linear.logit",
                 caliper = 0.2, std.caliper = TRUE)
summary(m.out, un = TRUE)
matched <- match_data(m.out)

# 2. Balance: standardised differences before and after, threshold 0.1
library(cobalt)
bal.tab(m.out, un = TRUE, thresholds = c(m = 0.1))

# 3. Weighting for the average treatment effect
library(WeightIt)
W <- weightit(drug ~ severity + age + diabetes + creatinine, data = icu,
              method = "glm", estimand = "ATE")
summary(W)
ESS(W$weights[icu$drug == 1])

# 4. E-values
library(EValue)
evalues.RR(0.70, lo = 0.55, hi = 0.89)
evalues.HR(0.73, lo = 0.66, hi = 0.81, rare = TRUE)
  • matchit defaults: method "nearest" (greedy nearest-neighbour), distance "glm" with a logit link, estimand "ATT", matching without replacement, and when a score is estimated, matching in descending order of the score. link = "linear.logit" matches on the logit. With std.caliper = TRUE the caliper is in standard deviation units.
  • bal.tab: un = TRUE prints the unadjusted sample as well. thresholds = c(m = 0.1) flags mean differences above 0.1. cobalt computes the standard deviation for the standardised difference in the full, unadjusted sample.
  • ESS gives the effective sample size of a weighted group, (Σw)² ÷ Σw².
  • evalues.OR and evalues.HR need rare = TRUE if the outcome is under 15% at the end of follow-up and FALSE otherwise.

SPSS

  1. Analyze > Regression > Binary Logistic. Select the treatment (coded 0/1) as the dependent variable and the baseline characteristics as covariates.
  2. Click Save and tick Probabilities under Predicted Values. SPSS saves each patient's predicted probability of the higher-coded category, which is the estimated propensity score.
  3. Use the saved score to form strata or weights, or take it to R for matching and balance tables.

How to report it

What should you write in the thesis or paper?

Say which confounders went into the score and why, which method you used and with what settings, how balance looked before and after, how many patients were lost, and how sensitive the result is to unmeasured confounding.

STROBE, item 12(a)

“Describe all statistical methods, including those used to control for confounding.”

STROBE, item 12(e)

“Describe any sensitivity analyses.”

STROBE, item 16(a)

“Give unadjusted estimates and, if applicable, confounder-adjusted estimates and their precision (e.g., 95% confidence intervals). Make clear which confounders were adjusted for and why they were included.”

STROBE, item 17

“Report other analyses done—e.g., analyses of subgroups and interactions, and sensitivity analyses.”

A worked sentence with the teaching numbers

“The propensity score for receiving the drug was estimated by logistic regression on severity, age, diabetes and creatinine, measured at admission. Treated patients were matched 1:1 without replacement to untreated patients by nearest-neighbour matching on the logit of the score, with a caliper of 0.2 standard deviations. After matching, all standardised mean differences were below 0.1. Death within 30 days had a risk ratio of 0.70 (95% CI 0.55 to 0.89). The E-values for the estimate and the upper confidence limit were 2.21 and 1.50.”

Also give the numbers matched and unmatched, the balance table before and after matching, and the crude estimate alongside the adjusted one (STROBE 16a). For weighting, give the weight type (ATE, ATT, stabilised or truncated) and the largest weights.

By specialty

Confounding by indication by specialty

Records show that patients with pneumonia who received a new drug died more often than those who did not.

The sicker patients were chosen for the drug. Adjust for severity before comparing, and check balance with standardised differences.

Common myths

Common mistaken beliefs

  • Myth: A propensity score study is as good as a randomised trial.

    Randomisation balances measured and unmeasured characteristics. A propensity score balances only the characteristics in the model, and assumes there are no unmeasured confounders (Austin, 2011).

  • Myth: Balance after matching is shown by p-values above 0.05.

    Significance tests for balance are discouraged: p-values depend on sample size, and the matched sample is smaller. Use standardised differences (Austin, 2011).

  • Myth: A propensity score model with a high c-statistic is a good model.

    The c-statistic provides no information about whether the model is correctly specified (Austin, 2011). Judge the model by the balance it produces.

  • Myth: Matching uses all the treated patients.

    Treated patients with no untreated patient inside the caliper are excluded from the matched sample (Austin, 2011). Report how many.

  • Myth: Mantel-Haenszel stratification can handle any number of confounders.

    Each added confounder multiplies the number of strata, and many strata end up with few or no patients in one group.

  • Myth: A large E-value proves there is no unmeasured confounding.

    It shows that considerable unmeasured confounding would be needed to explain the result away (VanderWeele and Ding, 2017), not that none exists.

Why this matters to you

Five consequences of ignoring confounding by indication

  1. A conclusion in the wrong direction

    In the teaching example the crude odds ratio of 2.12 made a beneficial drug look harmful.

  2. A thesis that cannot answer its question

    If the variables that decided treatment were never recorded, no analysis can adjust for them. Decide what to collect before data collection starts.

  3. Questions at the viva

    An examiner will ask how you checked balance. "The p-values were not significant" is the answer they expect to correct.

  4. Misreading papers

    A matched analysis that dropped half the treated patients, or a weighted analysis driven by a few huge weights, can be presented as if it described everyone.

  5. Harm to patients

    Observational results that are really confounding by indication can lead to useful treatments being withheld or useless ones being adopted.

History

History of stratification and propensity score methods

  1. 1959

    Nathan Mantel and William Haenszel

    Published "Statistical aspects of the analysis of data from retrospective studies of disease" in the Journal of the National Cancer Institute, the basis of the Mantel-Haenszel pooled estimate.

  2. 1968

    William G. Cochran

    Published "The effectiveness of adjustment by subclassification in removing bias in observational studies". Stratifying on the quintiles of a continuous confounder removed approximately 90% of the bias due to it.

  3. 1983

    Paul Rosenbaum and Donald Rubin

    Published "The central role of the propensity score in observational studies for causal effects" in Biometrika, defining the propensity score.

  4. 1984

    Rosenbaum and Rubin

    Published "Reducing bias in observational studies using subclassification on the propensity score", extending Cochran's quintile result to the propensity score.

  5. 1985

    Rosenbaum and Rubin

    Published "Constructing a control group using multivariate matched sampling methods that incorporate the propensity score". Austin (2011) summarises it as suggesting matching on the logit of the score with calipers.

  6. 2009

    Peter Austin

    Described balance diagnostics for propensity-score matched samples, including standardised differences and variance ratios.

  7. 2011

    Peter Austin

    Recommended, from simulations, matching on the logit of the propensity score with a caliper of 0.2 of its standard deviation.

  8. 2016

    Peng Ding and Tyler VanderWeele

    Derived a bounding factor for unmeasured confounding that makes no assumptions about the type of confounder.

  9. 2017

    Tyler VanderWeele and Peng Ding

    Introduced the E-value in Annals of Internal Medicine and proposed that it be reported in observational studies intended to show causality.

Guidelines

Propensity scores and confounding in guidance

Austin (2011), on balance

“For these reasons, the use of statistical significance testing to assess balance in propensity score matched samples is discouraged.”

Austin (2011), on calipers

Researchers are advised to use “a caliper of width equal to 0.2 of the standard deviation of the logit of the propensity score”.

VanderWeele and Ding (2017)

The authors “propose that in all observational studies intended to produce evidence for causality, the E-value be reported or some other sensitivity analysis be used”, for the estimate and for the confidence limit closest to the null.

STROBE explanation and elaboration (2007), items 12(a) and 16(a)

Describe the methods used to control for confounding, give unadjusted and confounder-adjusted estimates with their precision, and make clear which confounders were adjusted for and why.

Reading a paper

Five checks on any propensity score study

  • Which variables went into the score, were they measured before treatment, and is any important reason for choosing treatment missing?
  • Is balance shown with standardised differences before and after, not with p-values?
  • How many treated patients were left unmatched, or how large were the largest weights, and does the result still describe the population of interest?
  • Does the stated method match the estimand (ATT for matching, ATE or ATT for weighting), and were matched pairs analysed as matched?
  • Is there a sensitivity analysis for unmeasured confounding, such as an E-value for the estimate and the confidence limit?

Why is it called that?

Word surgery

“Propensity”

In everyday speech

A natural tendency, a habit.

In research

A probability: the chance that a patient with given characteristics receives the treatment, estimated from the data.

“Balance”

In everyday speech

Steadiness, or equal weight on both sides.

In research

Treated and untreated groups have similar distributions of baseline characteristics, shown by small standardised differences.

“Confounding”

In everyday speech

Confusing or astonishing someone.

In research

A mixing of the treatment effect with the effect of another factor linked to both treatment and outcome.

Memory trick

Stratify for one or two confounders. Score for many. Match or weight on the score, then check balance with standardised differences below 0.1, not p-values. Finish with an E-value for what was not measured.

Propensity

Latin propendere: "incline to, hang forward, weigh over"

How far a patient is inclined towards receiving the treatment.

Confound

Latin confundere: "to pour, mingle, or mix together"

The treatment effect and the effect of the confounder are mixed together in the crude comparison.

Stratum

Latin stratum: "thing spread out", from sternere "to spread out, lay down"

A layer of patients who share a value of the confounder. Plural: strata.

Caliper

short for "calliper compass", an instrument for measuring diameters

The largest difference in propensity score allowed within a matched pair.

IPTW

Inverse · Probability of · Treatment · Weighting

Each patient is weighted by 1 ÷ the probability of the treatment they received.

SMD

Standardised · Mean · Difference

The difference between group means divided by the pooled standard deviation.

Exam answers

Short-note outlines

Propensity score: definition, methods and limitations

  1. Definition: the probability of receiving the treatment conditional on observed baseline characteristics (Rosenbaum and Rubin, 1983). It is a balancing score: patients with the same score have similar distributions of measured characteristics.
  2. Why used: in observational studies treatment depends on patient characteristics (confounding by indication). The score reduces many confounders to one number.
  3. Estimation: logistic regression of treatment status on characteristics measured before treatment. The predicted probability is the score.
  4. Four methods (Austin, 2011): matching (nearest neighbour, caliper 0.2 SD of the logit, estimates ATT), stratification on quintiles (removes about 90% of bias from measured confounders), inverse probability of treatment weighting (1/e and 1/(1 − e), estimates ATE), covariate adjustment in the outcome model.
  5. Balance: standardised mean differences before and after, below 0.1 taken as negligible. Not p-values, not the c-statistic.
  6. Assumptions: no unmeasured confounders, and positivity (every patient has a probability of each treatment between 0 and 1).
  7. Limitations: adjusts only for measured variables. Unmatched patients are lost. Extreme weights make estimates unstable. Poor overlap limits whom the result applies to.
  8. Sensitivity analysis: E-value = RR + √[RR(RR − 1)] for the estimate and the confidence limit closer to 1 (VanderWeele and Ding, 2017).
  9. Reporting: STROBE items 12(a), 12(e), 16(a) and 17.

Confounding by indication and its control in observational studies

  • Definition: the reason for giving a treatment also affects the outcome, so treated and untreated patients differ before treatment. Example: sicker patients receive a drug and die more often.
  • Effect: the crude association can be exaggerated, hidden or reversed. Teaching example: crude OR 2.12, Mantel-Haenszel OR 0.65 after stratifying on severity.
  • Design stage: randomisation where possible, restriction to patients with the same indication, matching.
  • Analysis stage: stratification with the Mantel-Haenszel estimate, multivariable regression, propensity score matching, stratification, weighting or adjustment.
  • Checks: balance of baseline characteristics by standardised differences, overlap of the score distributions.
  • What remains: unmeasured confounding. Report an E-value or another sensitivity analysis.

Mantel-Haenszel method

  1. Purpose: combine 2 × 2 tables from strata of a confounder into one pooled odds ratio (or risk ratio), adjusted for that confounder (Mantel and Haenszel, 1959).
  2. Formula: ORMH = Σ(aidi/ni) ÷ Σ(bici/ni).
  3. Steps: stratify, compute stratum odds ratios, test whether they are similar (Breslow-Day), pool if similar, report each stratum if not.
  4. Worked example: severe 120/280 vs 40/60 (OR 0.64), mild 5/95 vs 28/372 (OR 0.70). ORMH = 18.12 ÷ 27.72 = 0.65 (95% CI 0.43 to 0.99), against a crude OR of 2.12.
  5. Test: Cochran-Mantel-Haenszel χ² with 1 df, here 4.12, p = 0.042.
  6. Limitations: handles few categorical confounders, continuous confounders must be categorised, sparse strata as confounders are added.

The one thing to remember

A propensity score makes treated and untreated patients alike only on the characteristics you measured. Check that it worked with standardised differences, not p-values, and state how strong an unmeasured confounder would have to be to change the result.

The pneumonia drug, the thesis data and all interactive simulations are made up for teaching. Numbers were computed in Python (SciPy 1.15, statsmodels 0.14).

Sources: Mantel N, Haenszel W. J Natl Cancer Inst 1959;22(4):719–48 (PMID 13655060). Cochran WG. Biometrics 1968;24(2):295–313 (PMID 5683871). Rosenbaum PR, Rubin DB. Biometrika 1983;70(1):41–55 (doi:10.1093/biomet/70.1.41). Rosenbaum PR, Rubin DB. J Am Stat Assoc 1984;79(387):516–24 (doi:10.1080/01621459.1984.10478078). Rosenbaum PR, Rubin DB. Am Stat 1985;39(1):33–8 (doi:10.1080/00031305.1985.10479383). Austin PC. Stat Med 2009;28(25):3083–107 (doi:10.1002/sim.3697, PMID 19757444). Austin PC. Multivariate Behav Res 2011;46(3):399–424 (doi:10.1080/00273171.2011.568786, PMID 21818162). Austin PC. Pharm Stat 2011;10(2):150–61 (doi:10.1002/pst.433, PMID 20925139). Austin PC, Stuart EA. Stat Med 2015;34(28):3661–79 (doi:10.1002/sim.6607, PMID 26238958). Ding P, VanderWeele TJ. Epidemiology 2016;27(3):368–77 (doi:10.1097/EDE.0000000000000457, PMID 26841057). VanderWeele TJ, Ding P. Ann Intern Med 2017;167(4):268–74 (doi:10.7326/M16-2607, PMID 28693043). VanderWeele TJ. Int J Epidemiol 2022;51(2):364–71 (doi:10.1093/ije/dyab218, PMID 34643669). Vandenbroucke JP et al. STROBE explanation and elaboration. PLoS Med 2007;4(10):e297 (doi:10.1371/journal.pmed.0040297, PMID 17941715). Rentsch CT et al. BMJ 2021;372:n311 (doi:10.1136/bmj.n311, PMID 33574135). Pérez-Belmonte LM et al. BMC Med 2020;18(1):359 (doi:10.1186/s12916-020-01832-2, PMID 33190637). Software: MatchIt 4.7.2, cobalt 5.0.0, WeightIt 2.0.0 and EValue 4.1.4 reference manuals (CRAN); EValue source code (CRAN mirror); IBM SPSS Regression 21 manual.

Further reading

Related Stateazy articles