Skip to content

Hypothesis testing, step by step

5 min read

Short answer

State a null hypothesis H0H_0 (no effect) and an alternative H1H_1, choose a significance level α\alpha, compute a test statistic, find the p-value, and reject H0H_0 if p<αp<\alpha. Failing to reject is not proof that H0H_0 is true.

Steps1State H0 and H1 (one- or two-sided)2Choose the significance level α (often 0.05)3Compute the test statistic from the sample4Find the p-value (or comparewith the critical value)5Decide: p < α rejects H0. Writethe conclusion in contextThe test asks how surprising the data would be if H0 were true.
The same five steps cover z-tests, t-tests and most others.

The logic

Assume H0H_0 is true and ask how likely data at least this extreme would be. If that probability is very small, the assumption becomes hard to believe, and you reject it. The framework is a proof by contradiction made probabilistic.

Choosing H1

Use a two-sided alternative (μ≠μ0\mu\neq\mu_0) unless you committed beforehand to one direction. A two-sided test splits α\alpha across both tails, so it needs a larger deviation to reject.

Worked example

A process should have mean 100100. A sample of n=36n=36 gives xˉ=104\bar x=104 with known σ=12\sigma=12. Test H0:μ=100H_0:\mu=100 against H1:μ≠100H_1:\mu\neq100 at α=0.05\alpha=0.05.

z=104−10012/36=42=2.0z=\dfrac{104-100}{12/\sqrt{36}}=\dfrac4{2}=2.0. Two-sided p≈0.0455<0.05p\approx0.0455<0.05, so reject H0H_0: there is statistically significant evidence that the mean differs from 100100.

Try it yourself

In the example, would you reject at α=0.01\alpha=0.01?

Show the answer

No. p≈0.0455>0.01p\approx0.0455>0.01, so you fail to reject at the 1% level (the same data are significant at 5% but not at 1%).

Keep going with practice

Vidi's probability lessons give you the distributions the test statistics are drawn from.