Hypothesis testing: z, t, F and chi-square tests
Set H₀ and H₁, fix α, compute the statistic, compare with the critical value. Type I error: rejecting a true H₀. Type II error: accepting a false H₀.
Procedure for testing a hypothesis
- 1★State the null hypothesis H₀ (no difference, no effect) and the alternative H₁.H₁ decides one-tailed or two-tailed
- 2Choose the level of significance α, e.g. 5%.
- 3Choose the test and its statistic (z, t, F or χ²) to suit the data and sample size.
- 4Find the critical value or region from tables for α and the degrees of freedom.
- 5Compute the test statistic from the sample.
- 6★Decide: reject H₀ if the computed value falls in the critical region (or the p-value is below α); otherwise do not reject it.
- 7State the conclusion in plain words.
★ one-way, controls the pace
Type I and Type II errors
| Decision | H₀ is true | H₀ is false |
|---|---|---|
| Reject H₀ | Type I error (α): a false alarm | Correct decision; probability = power (1 − β) |
| Do not reject H₀ | Correct decision; probability 1 − α | Type II error (β): a missed effect |
Which test when
| Test | Use it when | Statistic | Degrees of freedom |
|---|---|---|---|
| z test | Large sample (n > 30) or σ known; means or proportions | z = (x̄ − μ) ÷ (σ ÷ √n) | None needed (normal table) |
| t test (W. S. Gosset, 'Student', 1908) | Small sample (n ≤ 30) and σ unknown; one mean, two means or paired data | t = (x̄ − μ) ÷ (s ÷ √n) | n − 1 for one sample (or n pairs); n₁ + n₂ − 2 for two independent samples |
| F test (R. A. Fisher; named by Snedecor) | Equality of two variances; the basis of ANOVA for three or more means | F = larger variance ÷ smaller variance | (n₁ − 1, n₂ − 1), numerator sample first |
| Chi-square (Karl Pearson, 1900) | Goodness of fit; independence of attributes; a single variance | χ² = Σ(O − E)² ÷ E | k − 1, or (r − 1)(c − 1) |
Parametric vs non-parametric tests
Mann-Whitney U and Kruskal-Wallis H are the non-parametric cousins of the two-sample t test and one-way ANOVA.
Worked example 1: z test for a mean
A packaging firm claims its tea packets weigh 500 g on average, with σ = 12 g. A sample of 36 packets has a mean of 496 g. Test the claim at 5% and at 1% (two-tailed).
- H₀: μ = 500 g; H₁: μ ≠ 500 g.
- Standard error = σ ÷ √n = 12 ÷ √36 = 12 ÷ 6 = 2.
- z = (496 − 500) ÷ 2 = −2, so |z| = 2.
- At 5%, 2 > 1.96: reject H₀. At 1%, 2 < 2.58: do not reject H₀.
|z| = 2. The mean weight differs significantly from 500 g at the 5% level but not at the 1% level.
Worked example 2: one-sample t test
Nine salespersons made a mean of 52 calls a week, with sample SD s = 6. Is this significantly different from the target of 48 at 5%? (t for 8 df, two-tailed 5% = 2.306)
- H₀: μ = 48. n = 9 is small and σ is unknown, so use t with df = 9 − 1 = 8.
- Standard error = s ÷ √n = 6 ÷ 3 = 2.
- t = (52 − 48) ÷ 2 = 2.0.
- 2.0 < 2.306, so do not reject H₀.
t = 2.0 with 8 df; the difference is not significant at 5%.
Worked example 3: chi-square test of independence
A survey of 100 shoppers: 30 men and 20 women prefer buying online; 20 men and 30 women prefer stores. Is preference independent of gender at 5%? (χ² for 1 df at 5% = 3.841)
- Row totals: men 50, women 50. Column totals: online 50, store 50. N = 100.
- Each expected frequency E = row total × column total ÷ N = 50 × 50 ÷ 100 = 25.
- χ² = (30 − 25)²/25 + (20 − 25)²/25 + (20 − 25)²/25 + (30 − 25)²/25 = 1 + 1 + 1 + 1 = 4.0.
- df = (2 − 1)(2 − 1) = 1. Since 4.0 > 3.841, reject H₀.
χ² = 4.0 > 3.841, so preference is associated with gender at the 5% level.
NET asks which test fits a situation (small sample and unknown σ → t; two variances → F; attributes → χ²), the meaning of Type I and Type II errors, critical values and degrees of freedom, and short z or χ² calculations.
Typical MCQ: “n = 16, x̄ = 53, s = 4 and H₀: μ = 50. Find t and its df.” t = (53 − 50) ÷ (4 ÷ √16) = 3 ÷ 1 = 3, with df = 15. Trap: dividing by n instead of √n, or using df = 16.
Typical MCQ: “What is the critical z for a two-tailed test at 5%?” ±1.96. Trap: 1.645 is the one-tailed 5% value.
Typical MCQ: “What is the power of a test?” 1 − β: the probability of rejecting H₀ when it is false. Trap: confusing it with 1 − α, the confidence level.
Type I = false alarm (convicting an innocent H₀); Type II = missed catch (freeing a guilty H₀). Small sample and unknown σ → t; two variances → F; counts in a table → χ².