Statistics Quest

Hypothesis testing: the framework

A hypothesis test measures how surprising the data would be if a stated null hypothesis about a parameter were true, and turns that into a decision at a pre-chosen significance level.

test statistic=estimate−null valuestandard error of the estimate\text{test statistic} = \frac{\text{estimate} - \text{null value}}{\text{standard error of the estimate}}
Most tests in this reference share this shape: a standardised distance from the null value.
estimate\text{estimate}
The sample statistic, e.g. xˉ\xbar, p^\phat or xˉ1−xˉ2\xbar_1 - \xbar_2.
null value\text{null value}
The parameter value stated by H0H_0, e.g. μ0\mu_0 or 00.
standard error\text{standard error}
The estimated standard deviation of the estimate across repeated samples.
reject H0  ⟺  p≤α\text{reject } H_0 \iff p \le \alpha
The decision rule.
pp
The p-value of the observed statistic.
α\alpha
The significance level, fixed before seeing the data (often 0.05).

When to use

  • You have a specific claim about a population parameter (a mean, a proportion, a difference) and want to know whether the data provide evidence against it.
  • Pair every test with an estimate and a confidence interval: the test answers "is there evidence of a difference?", the interval answers "how big might it be?".

Assumptions

Every test has a model: how the data were collected (random sampling or random assignment, independence) and, for some tests, a distributional shape. The p-value is only as trustworthy as that model.

How to interpret

The workflow:

  1. State the hypotheses about a parameter (never a statistic). H0H_0 is the "no effect / no difference" claim with an equality, e.g. H0:μ=30H_0: \mu = 30; H1H_1 is two-sided (μ≠30\mu \ne 30) or one-sided (μ>30\mu > 30), chosen before looking at the data.
  2. Choose α\alpha (the Type I error rate you accept).
  3. Check conditions for the chosen test.
  4. Compute the test statistic and its p-value.
  5. Decide: if p≤αp \le \alpha, reject H0H_0 ("statistically significant evidence against H0H_0"); otherwise fail to reject H0H_0 ("the data are consistent with H0H_0; not enough evidence against it").
  6. Report in context: estimate, confidence interval, effect size, p-value, and what it means for the decision at hand.

Failing to reject is not evidence that H0H_0 is true: a small or noisy sample can fail to detect a real effect.

Common mistakes

  • Writing hypotheses about statistics ("H0:xˉ=30H_0: \xbar = 30").
  • Choosing a one-sided alternative after seeing which way the data point.
  • Saying "we accept H0H_0" or "the test proves there is no difference".
  • Treating "significant" as "important": with large samples tiny effects are significant. Look at the effect size and interval.
  • Running many tests and reporting only the significant ones (see multiple comparisons).

Example

A courier claims a mean delivery time of 12 minutes. Eight timed deliveries: 12, 15, 11, 14, 13, 16, 12, 15 minutes. H0:μ=12H_0: \mu = 12 vs H1:μ≠12H_1: \mu \ne 12, α=0.05\alpha = 0.05. A one-sample t-test gives xˉ=13.5\xbar = 13.5, t=2.39t = 2.39 on 7 df, p=0.048p = 0.048. Since p≤0.05p \le 0.05, reject H0H_0: the data are evidence that the mean differs from 12 minutes; the 95% CI (12.02 to 14.98 minutes) suggests deliveries take longer on average, by somewhere between a few seconds and about 3 minutes.