$$z_{\text{obs}} = \frac{\bar{x}-\mu_0}{\sigma/\sqrt{n}} \sim N(0,1) \text{ under } H_0$$
Example 1: A machine fills bags. Claimed $\mu = 500$ g, $\sigma = 8$ g. Sample: $n=64$, $\bar{x} = 498$ g. Test at $\alpha=0.05$ (two-tailed).
$z = \dfrac{498-500}{8/8} = \dfrac{-2}{1} = -2$.
p-value $= 2P(Z < -2) = 2(0.0228) = 0.0456 < 0.05$.
Reject $H_0$. There is evidence the mean fill is not 500 g.
$$z_{\text{obs}} = \frac{\hat{p}-p_0}{\sqrt{p_0(1-p_0)/n}}$$
Example 2: A coin is tossed 200 times: 115 heads. Test $H_0: p=0.5$ vs $H_1: p > 0.5$ at $\alpha=0.05$.
$\hat{p} = 0.575$. $z = \dfrac{0.575-0.5}{\sqrt{0.25/200}} = \dfrac{0.075}{0.0354} \approx 2.12$.
p-value $= P(Z > 2.12) = 1 - 0.9830 = 0.0170 < 0.05$.
Reject $H_0$. Sufficient evidence that $p > 0.5$ at the 5% level.
The p-value is the probability of obtaining a test statistic at least as extreme as the observed value, under the assumption that $H_0$ is true.
p-value and significance level:
- $p < \alpha$: Data is inconsistent with $H_0$ at significance level $\alpha$ $\Rightarrow$ reject $H_0$
- $p \geq \alpha$: Insufficient evidence to reject $H_0$
| Hypotheses | Test type | p-value calculation |
|---|---|---|
| $H_1: \mu \neq \mu_0$ | Two-tailed | $2P(Z > |
| $H_1: \mu > \mu_0$ | Right-tailed | $P(Z > z_{\text{obs}})$ |
| $H_1: \mu < \mu_0$ | Left-tailed | $P(Z < z_{\text{obs}})$ |
A statistically significant result (small p-value) does not necessarily mean the effect is large or practically important.
With very large $n$, even tiny differences from $\mu_0$ become statistically significant.
Always comment on the size of the observed difference in context.
KEY TAKEAWAY: A hypothesis test quantifies evidence against the null hypothesis. The p-value and significance level together determine whether the null hypothesis is rejected.
EXAM TIP: When concluding, say “There is sufficient evidence at the $\alpha$% significance level to conclude…” or “There is insufficient evidence…”. Never say “we accept $H_0$”.
COMMON MISTAKE: Using a one-tailed test when the direction of the difference was determined by looking at the data (data snooping). The direction in $H_1$ must be specified before seeing the data.