Hypothesis testing is the formal machinery behind a question that comes up constantly in research, business, and everyday claims: is this difference real, or could it just be random noise? A new drug seems to work better than a placebo β but is the improvement large enough that chance alone is an unlikely explanation? A website redesign seems to increase sign-ups β but with only a few thousand visitors, could that just be luck? Hypothesis testing gives you a structured, repeatable way to answer exactly this kind of question, with a quantified level of confidence attached to the answer.
- How to state a null and alternative hypothesis precisely
- What a p-value actually means β and the two things it commonly gets confused with
- Type I and Type II errors, and the real trade-off between them
- The full six-step hypothesis testing framework, worked through an example
The Null and Alternative Hypothesis
Every hypothesis test starts with two competing statements about a population, framed so they're mutually exclusive and cover every possibility:
- Null hypothesis (Hβ): the "nothing interesting is happening" baseline β no effect, no difference, no relationship. This is the statement you assume true until the data gives you strong enough reason to doubt it.
- Alternative hypothesis (Hβ or Hβ): the claim you're actually interested in testing β there is an effect, a difference, or a relationship.
For a new drug trial, Hβ might be "the drug has no effect on recovery time" and Hβ "the drug reduces recovery time." Crucially, the test is designed to reject Hβ in favour of Hβ when the evidence is strong enough β it never directly "proves" Hβ true. Failing to reject Hβ just means the data didn't provide strong enough evidence against it, which is a meaningfully weaker claim than "Hβ is definitely true."
Significance Level (Ξ±): How Much Risk You'll Accept
Before looking at the data, you choose a significance level, Ξ± β conventionally 0.05 (5%). This is the probability of rejecting Hβ when Hβ is actually true (a false alarm), that you're willing to accept. Choosing Ξ± = 0.05 doesn't mean "5% chance I'm wrong about my final conclusion" β it specifically means "if Hβ is really true, and I ran this exact test many times, I'd incorrectly reject it about 5% of the time."
The Test Statistic and the P-Value
Once you have data, you calculate a test statistic β a single number (z, t, ΟΒ², or F depending on the test) that measures how far your sample result is from what Hβ predicts, standardized so it can be compared against a known reference distribution.
From the test statistic, you find the p-value: the probability of observing a result at least as extreme as yours, if Hβ were actually true. A small p-value means your result would be quite unlikely under Hβ β which is evidence against Hβ.
A p-value is not the probability that Hβ is true, and it is not the probability that your result happened "by chance" in some general sense. It's a conditional probability: P(this data or more extreme | Hβ is true). Confusing this with P(Hβ is true | this data) is one of the most common and consequential misreadings in applied statistics β the two are genuinely different quantities and can differ enormously.
The Decision Rule
That's the entire mechanical decision. If p = 0.03 and Ξ± = 0.05, you reject Hβ β the result is "statistically significant" at the 5% level. If p = 0.12, you fail to reject Hβ β the evidence isn't strong enough, at your chosen risk threshold, to conclude there's a real effect.
Type I and Type II Errors
Every hypothesis test carries two distinct ways to be wrong, and they trade off against each other:
- Type I error (false positive): rejecting Hβ when it's actually true β concluding there's an effect when there isn't one. Its probability is exactly Ξ±, the significance level you chose.
- Type II error (false negative): failing to reject Hβ when it's actually false β missing a real effect that's genuinely there. Its probability is called Ξ², and 1 β Ξ² is the test's statistical power β its ability to detect a real effect when one exists.
Lowering Ξ± (say, from 0.05 to 0.01) to reduce false positives makes it harder to reject Hβ at all, which mechanically increases the Type II error rate β you can't reduce both types of error simultaneously just by moving the threshold; the only way to reduce both is a larger sample size, which sharpens the test's ability to distinguish real effects from noise.
Worked Example: The Full Six Steps
Problem: A factory's bolts have historically had a mean breaking strength of 500N. A new supplier's bolts are tested on a sample of 36 bolts, giving a sample mean of 512N with a sample standard deviation of 30N. At Ξ± = 0.05, is there evidence the new supplier's bolts have a different mean breaking strength?
1. Hypotheses: Hβ: ΞΌ = 500N. Hβ: ΞΌ β 500N (a two-tailed test, since we care about "different," not specifically "higher").
2. Significance level: Ξ± = 0.05.
3. Test statistic: with n = 36 (β₯30, so a z-test is a reasonable approximation): z = (xΜ β ΞΌ) / (s/βn) = (512 β 500) / (30/β36) = 12 / 5 = 2.4
4. P-value: for a two-tailed test, p = 2 Γ P(Z > 2.4) β 2 Γ 0.0082 = 0.0164
5. Decision: p (0.0164) < Ξ± (0.05) β reject Hβ
6. Conclusion: There is statistically significant evidence, at the 5% level, that the new supplier's bolts have a mean breaking strength different from 500N.
One-Tailed vs. Two-Tailed Tests
The bolt example used a two-tailed test because Hβ was "different from" (could be higher or lower). If the research question specifically predicted a direction β "the new bolts are stronger," not just "different" β a one-tailed test (Hβ: ΞΌ > 500) would be used instead, which concentrates the entire rejection region in one tail and makes it somewhat easier to reach significance in that specific direction. The choice must be made before looking at the data, based on the actual research question β choosing it afterward, based on which direction the data happened to point, invalidates the test's error-rate guarantees.
Statistical Significance vs. Practical Significance
A result can be statistically significant while being practically meaningless, especially with a large sample size. With n = 100,000, even a genuinely tiny, real difference (say, a new webpage design increasing conversion by 0.02 percentage points) can produce a very small p-value β the sample is large enough to detect it with confidence, but the effect itself may be too small to matter commercially. This is exactly why effect size (which measures the magnitude of a difference, not just whether one exists) should always be reported alongside a p-value, not instead of it.
Common Mistakes to Avoid
P-hacking: running many different tests, or repeatedly checking results as data trickles in, and reporting only the test that happened to cross the significance threshold. This inflates the true false-positive rate far above the stated Ξ±, because you're implicitly running many tests and cherry-picking the "significant" one β the 5% error rate only holds for a single, pre-planned test.
Treating "not significant" as "no effect": a non-significant result with a small sample often means the study was underpowered to detect a real effect, not that no effect exists. Reporting a confidence interval alongside the p-value makes this distinction visible β a wide interval that includes both "no effect" and "a fairly large effect" tells a very different story than a narrow interval tightly centred on zero.
Ignoring assumptions: every test (t-test, chi-square, ANOVA) carries assumptions β independence of observations, a roughly normal population or a large enough sample for the CLT to apply, and so on. Skipping the check and running the test anyway can produce a p-value that looks precise but rests on a broken foundation.
What does "fail to reject Hβ" actually mean β is it the same as accepting Hβ?
Why is 0.05 the conventional significance level?
Can you ever be certain Hβ is false?
How do I choose which statistical test to use?
Share this article
Written by
Statistics Fundamentals Editorial Team
Written and reviewed by our team of statistics educators. Content is aligned with GCSE, A-Level, AP Statistics, and undergraduate curricula.
About Statistics Fundamentals β