A hypothesis test asks whether a sample result is surprising enough to reject a stated claim about the population. Every test follows the same five steps; only the test statistic changes.
Hypotheses
The null hypothesisH0 states the value being tested — the status quo, the manufacturer's claim, "no change".
The alternative hypothesisH1 states what you suspect instead.
H0:μ=500H1:μ=500
A test can rejectH0 or fail to reject it. It never provesH0 true: failing to find evidence against a claim is not the same as establishing it.
One- and two-tailed tests
The wording of the question decides which:
Suspicion
H1
Test
"has changed", "differs from"
μ=μ0
two-tailed
"has increased", "is greater than"
μ>μ0
one-tailed (upper)
"has decreased", "is less than"
μ<μ0
one-tailed (lower)
A two-tailed test splits the significance level between both tails; a one-tailed test puts it all in one, which makes it easier to reject H0in that direction.
The significance level and critical region
The significance levelα is how much evidence is demanded — conventionally 5% or 1%. It is the probability of rejecting H0 when it is actually true.
The critical region is the set of test statistic values that lead to rejection:
Test
α=5%
α=1%
Two-tailed
∣z∣>1.96
∣z∣>2.576
One-tailed
z>1.645 (or <−1.645)
z>2.326
The z-test for a mean
When σ is known (or n is large):
z=σ/nxˉ−μ0
A machine is set to fill bottles to 500 ml with σ=20. A sample of 40 bottles has mean 508 ml. Test at the 5% level whether the mean has changed.
1. Hypotheses.H0:μ=500; H1:μ=500 (two-tailed — "changed" gives no direction).
4. Compare.2.53>1.96, so the statistic falls in the critical region.
5. Conclude in context. Reject H0: there is evidence at the 5% level that the mean fill volume has changed from 500 ml.
p-values
The p-value is the probability of a result at least as extreme as the one observed, assuming H0 is true.
Reject H0 if p<α
For the example above:
p=2(1−Φ(2.53))=2(0.0057)=0.0114
Since 0.0114<0.05, reject H0 — the same conclusion as the critical value method, as it must be.
The doubling is what makes it two-tailed: a result 2.53 standard errors below the claim would be equally surprising.
Type I and Type II errors
H0 true
H0 false
Reject H0
Type I error (α)
correct
Fail to reject
correct
Type II error (β)
Type I — rejecting a true null hypothesis. A "false alarm". Its probability is exactly α, which is why you choose α: it is the false-alarm rate you are willing to accept.
Type II — failing to reject a false null hypothesis. A "missed detection". Its probability β depends on how wrong H0 actually is — a large discrepancy is easy to detect, a small one is not.
The power of a test is 1−β: the probability of correctly detecting a real effect.