liveBook · Manning

Mean difference

As explained in Causal Inference for Data Science

A difference in means is a sample statistic obtained by subtracting the mean outcome for one group from the mean outcome for another group.

A mean difference subtracts the average outcome for one group from the average outcome for another: mean(O | T = 1) − mean(O | T = 0). It describes how outcomes differ between treated and untreated groups, but the difference is causal only when group assignment supports that interpretation. section 2.5 section 2.5.1

Randomized treatment

In an RCT or A/B test, random assignment removes confounding from treatment assignment. The observed mean difference therefore estimates the causal effect directly, without applying the adjustment formula. section 2.5.1

For a causal calculation, compare the two intervention quantities: E[O | do(T = 1)] and E[O | do(T = 0)]. Their difference is the average treatment effect (ATE). The observed mean difference, E[O | T = 1] − E[O | T = 0], estimates it reliably only under suitable assumptions or after adjustment. section 2.5

Why naive differences can mislead

A synthetic dataset with an unobserved confounder produces a naive mean difference of 1.0004 even though the treatment effect is −2. An instrumental-variable estimate of −1.8898 is much closer to the target. section 9.3

Table 2.6 Exercise results
True ATE
 
E[ O| T = 1] – E[ O| T = 0]
 
adjustment(1) – adjustment(0)
 
Estimation of ATE
 

Use the exercise table to compare the true ATE, observed mean difference, adjusted estimates, and final ATE estimation. section 2.5

How Causal Inference for Data Science covers it

How deep it goes
Defines the statistic, relates it to intervention means and the ATE, and demonstrates bias, but defers a full adjustment treatment.
Examples
Uses RCT and A/B test comparisons, an exercise table, and synthetic confounded data analyzed with R and Python.
What it assumes
Assumes familiarity with treatment, outcome, expectations, and causal effects while developing the distinction between observed and intervened quantities.
What you can do after
Apply it via group means to estimate effects in randomized data and diagnose why an observational estimate may be biased.
How it connects
Connects mean differences to average treatment effects, randomized controlled trials, confounding, adjustment formulas, instrumental variables, and regression discontinuity designs.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal Inference for Data Science. The section links point to the parts of the book it draws on.