Does a coaching program improve a 30-day recovery score? Sicker patients are more likely to receive coaching—and tend to recover less well.
Each patient's recorded outcome stays the same when you switch methods. Raw comparison counts everyone once. Matching averages only the retained patients. IPTW changes how much each patient contributes to their group's average. The difference between the two averages is the estimated coaching effect.
“Points contributed” is one piece of a group average, not a new outcome for that patient. All patient shares within a group add to 100%; their point contributions add to that group's mean.
| Method | Coaching average | Routine-care average |
|---|
Use total analysis weight as the denominator. For raw comparison and matching, this equals included headcount. ESS is a diagnostic, not the denominator. Displayed values are rounded to 3 decimals; calculations use full precision.
| Patient | Score y | Propensity e | Weight w | Product w × y | Group share | Mean points |
|---|
Totals above use the whole group, including rows on other pages. Unmatched patients remain visible with weight 0. Select a patient number to follow that person's arithmetic in step 1.
Estimated effect = coaching average − routine-care average. Positive values favor coaching on this fictional recovery score.
In this invented model, each extra severity point lowers expected recovery by 0.48 points. A group that starts sicker therefore has a lower average even before considering coaching. Matching and weighting change the severity mix being averaged.
| Method | True benefit | Severity term | Noise term | Estimated effect |
|---|
This decomposition is possible because the simulator knows the true benefit and each person's random noise. Real observational studies do not know those quantities. Adjustment can reduce measured confounding; it does not force the result to equal the truth. Changing the “true benefit” slider creates different simulated outcomes; switching analysis methods keeps them fixed.
Baseline severity mix · share of each group (%)
Both colors use the same 0–100% scale. Under IPTW, bars show weighted shares.
Coaching minus routine care · recovery score points
| Method | |SMD| | Included | ESS* |
|---|
*ESS = sum of the two groups' effective sample sizes; a weight-concentration diagnostic, not an exact precision estimate.
Use the same patients throughout: start with the raw comparison, then match pairs, then apply IPTW. Watch what changes—and which people keep their original group.
The propensity score, e, is the probability of receiving coaching given baseline severity. It is estimated here by logistic regression using all 160 patients, before comparing outcomes.
Matching: 1:1 nearest-neighbor matching without replacement, in a fixed seeded patient order. The maximum permitted distance is the slider value × the full cohort's sample SD of the logit of the propensity score. Each retained patient counts once; no one switches group.
IPTW: coaching patients receive weight 1/e; routine-care patients receive 1/(1−e). Stabilization multiplies these by the observed coaching share and routine-care share, respectively. Each outcome mean is divided by its group's sum of weights.
IPTW shown here targets the ATE: the average effect in the original eligible population. It retains everyone, but rare treatment choices can receive large weights when overlap is poor.
Matching starts with an ATT target: the effect among coaching recipients. If the caliper excludes some recipients, the result pertains to the retained, matchable recipients—not automatically to every treated patient. The fictional benefit is constant, so these target effects happen to be identical here.
Both methods rely on adequate overlap, a suitable propensity model, and measuring the relevant confounders. Neither fixes unmeasured confounding or guarantees balance in every sample. The example contains severity as its only confounder.
160 newly generated fictional records; severity from 0 to 100. Coaching probability follows a logistic model whose slope is controlled by selection strength. Recovery = 78 − 0.48 × severity + individual noise + the true benefit if coached. Changing the benefit leaves treatment assignment and matching unchanged.
No real patients, study data, clinical claims, or product names. This is a teaching simulation. The recovery score and all generating rules are invented.
|SMD| is the absolute difference in severity means divided by the original unweighted pooled within-group SD, kept fixed across methods. Below 0.10 is a common balance heuristic, not proof that confounding has vanished.
Within each group, ESS = (sum of weights)² / sum of squared weights. Weighted totals are analytical influence, not extra patients. No confidence intervals are shown; real inference must account for weighting or matched pairs.
Method references: Austin & Stuart, 2015; Austin, 2011.