Confidence intervals

core 9 mininferenceconfidence-intervalsuncertainty

Builds on:CLT and sampling distributions

The idea

A point estimate without an error bar is a guess. The confidence interval turns the standard error into a range of parameter values that are compatible with the data:

estimate  ±  z∗×SE\text{estimate} \; \pm \; z^* \times \text{SE}

For a mean: xˉ±1.96 s/n\bar{x} \pm 1.96\, s/\sqrt{n} at 95%. For a proportion: p^±1.96p^(1−p^)/n\hat{p} \pm 1.96 \sqrt{\hat{p}(1-\hat{p})/n}. The multiplier z∗z^* comes straight from the normal sampling distribution the CLT provides: 1.645 for 90%, 1.96 for 95%, 2.576 for 99% (swap in tt critical values when nn is small).

What "95%" means is the most-tested subtlety in statistics. The parameter is fixed; the interval is the random object. The guarantee is about the factory, not the widget: the procedure produces intervals that cover the truth in 95% of repeated samples. Once the numbers are in, this interval either covers or it does not — assigning it "95% probability" is, strictly, a Bayesian statement that requires a prior. (In practice, with reasonable priors the Bayesian credible interval is numerically similar, which is why the sloppy reading usually survives contact with reality.)

Two properties worth having at your fingertips:

CIs beat p-values as a reporting tool because they keep effect size in view. "Significant" could mean a microscopic effect measured precisely; "not significant" could mean an underpowered test whose interval still contains a fortune. The interval shows which.

Worked example

Same A/B numbers as the testing example — control 500/5,000 (10%), treatment 550/5,000 (11%):

SEdiff=0.10×0.905000+0.11×0.895000≈0.00613\text{SE}_{\text{diff}} = \sqrt{\frac{0.10 \times 0.90}{5000} + \frac{0.11 \times 0.89}{5000}} \approx 0.00613

CI95%=0.01±1.96×0.00613=0.01±0.0120  ≈  (−0.002,  0.022)\text{CI}_{95\%} = 0.01 \pm 1.96 \times 0.00613 = 0.01 \pm 0.0120 \;\approx\; (-0.002, \; 0.022)

Reading it out loud: the data is consistent with anything from a 0.2-point loss to a 2.2-point gain. Three separate conclusions, all visible at a glance:

  1. Contains zero → not significant at 5% (matches p≈0.10p \approx 0.10).
  2. Contains +2 points (a 20% relative lift) → absolutely not "proof of no effect"; the test is underpowered for effects we care about.
  3. Decision: keep collecting or re-size the experiment — the interval, unlike the p-value, says so directly.

To halve this interval's width you would need 4×5000=20,0004 \times 5000 = 20{,}000 users per arm.

Cheat sheet

SituationRead
CI excludes 0, effect above practical thresholdsignificant and meaningful — ship-worthy evidence
CI excludes 0, effect tinystatistically real, practically irrelevant
CI contains 0 but also large effectsunderpowered / inconclusive — do not claim "no effect"
CI hugs 0 tightlywell-powered null result — genuinely small-or-no effect

Gotchas: