Skip to the content

Topics Covered

t-test (single mean) t-test (difference) Paired t-test t-test (correlation) χ² Goodness of Fit χ² Independence χ² for Variance F-test
On this page
  1. 1. Why Small Sample Tests?
  2. 2. t-test for Single Mean
  3. 3. t-test for Difference of Two Means (Independent Samples)
  4. 4. Paired t-test (Dependent Samples)
  5. t-test for a Correlation Coefficient
  6. 5. χ² Test for Goodness of Fit
  7. 6. χ² Test for Independence (Contingency Tables)
  8. 7. χ² Test for Single Variance
  9. 8. F-test for Equality of Two Variances
  10. 9. Choosing the Right Small-sample Test
  11. Key Take-aways
  12. Extra Practical Problems
  13. Worked Problems on Small Sample Tests

1. Why Small Sample Tests?

When \(n\) is small (\(n \le 30\)) and the population is normal but \(\sigma\) is unknown, the Z-test does not apply. Instead we use Student's t, χ² and F distributions developed precisely for small samples.

Assumption: the parent population is normal (or approximately so).

Student's t vs. standard normal -4 -3 -2 -1 0 1 2 3 4 Normal (df = ∞) t, df = 5 t, df = 1 (heavy tails) heavier tails
Fig 4.1 — Why a special distribution for small samples: Student's \(t\) has the same bell shape as the standard normal but a lower peak and heavier tails. With few degrees of freedom (\(df = 1\)) the extra tail probability is large, so critical values are bigger than \(1.96\); as \(df\) grows the \(t\) curve tightens onto the normal (\(df = \infty\)).

When is a Sample Small?

The working rule: a sample of size less than 30 is treated as small, and the tests built for such samples are the small sample tests. The boundary is a rule of thumb, not a sharp line.

What makes a test "small-sample" is not the size itself but what the test relies on. A large sample test leans on the central limit theorem: whatever the parent population, the statistic is approximately normal. A small sample cannot lean on that, so these tests use the exact sampling distributions of their statistics — \(\chi^2\), \(t\) and \(F\) (and \(z\) when the population standard deviation is known) — which are exact only when the parent population is normal. The \(\chi^2\) tests of fit and of independence (§5–6) are the exception: there \(\chi^2\) is itself a large-sample approximation, which is why they ask for expected frequencies of at least 5.

Assumptions of Student's t-test

  1. The parent population from which the sample is drawn is normal.
  2. The sample observations are independent, that is, the sample is random.
  3. The population standard deviation \(\sigma\) is unknown. (If it is known, the \(z\) statistic of Unit 3 applies, even to a small sample — Worked Problem 1 below is exactly that case.)

Two Ways of Writing the Sample Variance

The \(t\) statistic is written in two forms that look different and are the same number. The derivations use the sample variance with divisor \(n\); the formula boxes use the one with divisor \(n-1\). On this page \(s^2\) always means divisor \(n\) and \(S^2\) divisor \(n-1\):

\[ s^2 = \frac{1}{n}\sum_{i=1}^{n}(x_i - \bar x)^2, \qquad S^2 = \frac{1}{n-1}\sum_{i=1}^{n}(x_i - \bar x)^2 . \]

Statement. \(\dfrac{s}{\sqrt{n-1}} = \dfrac{S}{\sqrt n}\), so \(\dfrac{\bar x - \mu_0}{s/\sqrt{n-1}}\) and \(\dfrac{\bar x - \mu_0}{S/\sqrt n}\) are the same statistic.

Proof. Both variances divide the same sum of squares, so

\[ n s^2 = \sum_{i=1}^{n}(x_i - \bar x)^2 = (n-1) S^2 . \]

Divide both sides by \(n(n-1)\):

\[ \frac{s^2}{n-1} = \frac{S^2}{n} . \]

Both sides are positive, so taking square roots keeps the equality: \(\dfrac{s}{\sqrt{n-1}} = \dfrac{S}{\sqrt n}\). □

The computing form of \(s^2\) used in the problems comes from expanding the square: \(\sum(x_i - \bar x)^2 = \sum x_i^2 - 2\bar x\sum x_i + n\bar x^2 = \sum x_i^2 - n\bar x^2\), because \(\sum x_i = n\bar x\). Dividing by \(n\),

\[ s^2 = \frac{1}{n}\sum x_i^2 - \bar x^2 . \]

2. t-test for Single Mean

\(H_0: \mu = \mu_0\). With sample mean \(\bar X\) and sample SD \(S\) (divisor \(n-1\)):

\[ t \;=\; \dfrac{\bar X - \mu_0}{S/\sqrt n} \;\sim\; t_{n-1}. \]

Where the t Statistic Comes From

Let \(x_1, x_2, \ldots, x_n\) be a random sample from \(N(\mu, \sigma^2)\). Test \(H_0: \mu = \mu_0\) (the sample has been drawn from a population with mean \(\mu_0\)) against \(H_1: \mu \ne \mu_0\), \(\mu > \mu_0\) or \(\mu < \mu_0\).

Case 1: \(\sigma\) known. The sample mean of a normal sample is itself normal, \(\bar x \sim N(\mu, \sigma^2/n)\), whatever \(n\) is. Standardising it,

\[ z = \frac{\bar x - \mu_0}{\sigma/\sqrt n} \sim N(0, 1) \quad\text{under } H_0, \]

so the normal test applies to a small sample too.

Case 2: \(\sigma\) unknown. Now \(\sigma\) must be estimated, and the estimate brings its own randomness. Two facts about a normal sample are used.

  1. \(\bar x \sim N(\mu, \sigma^2/n)\), so \(Z = \dfrac{\bar x - \mu}{\sigma/\sqrt n} \sim N(0,1)\).
  2. \(\dfrac{n s^2}{\sigma^2} \sim \chi^2_{n-1}\), and it is independent of \(\bar x\).

By the definition of Student's \(t\): a standard normal variate divided by the square root of an independent \(\chi^2\) variate over its degrees of freedom has the \(t\) distribution with those degrees of freedom. So

\[ t = \frac{Z}{\sqrt{\dfrac{n s^2/\sigma^2}{n-1}}} = \frac{\dfrac{\bar x - \mu}{\sigma/\sqrt n}}{\dfrac{s}{\sigma}\sqrt{\dfrac{n}{n-1}}} \sim t_{n-1} . \]

The unknown \(\sigma\) appears once in the numerator's denominator and once in the denominator, so it cancels:

\[ t = \frac{\bar x - \mu}{\sigma/\sqrt n}\cdot\frac{\sigma}{s}\sqrt{\frac{n-1}{n}} = \frac{(\bar x - \mu)\sqrt{n-1}}{s} = \frac{\bar x - \mu}{s/\sqrt{n-1}} . \]

That cancellation is the whole point: the statistic can be computed without knowing \(\sigma\), and its distribution, \(t_{n-1}\), does not depend on \(\sigma\) either. Under \(H_0\),

\[ t = \frac{\bar x - \mu_0}{s/\sqrt{n-1}} = \frac{\bar x - \mu_0}{S/\sqrt n} \sim t_{n-1} , \]

the two forms being equal by §1. Inference: if \(|t|\) exceeds the table value \(t_{\alpha, n-1}\) for the test in hand (two-tailed or one-tailed), reject \(H_0\); otherwise do not reject it.

Confidence Limits for the Mean

Turning the test around gives an interval. Since \(P\!\left(-t_{\alpha/2} \le \dfrac{\bar x - \mu}{s/\sqrt{n-1}} \le t_{\alpha/2}\right) = 1 - \alpha\), rearranging the inequalities for \(\mu\) gives the \(100(1-\alpha)\%\) confidence limits

\[ \bar x \pm t_{\alpha/2,\,n-1}\,\frac{s}{\sqrt{n-1}} . \]

An interval has two ends, so it uses the two-tailed point: for 95% limits \(t_{0.025}\), for 99% limits \(t_{0.005}\). Worked Problem 5 below shows what goes wrong when a one-tailed table value is used instead.

EXAMPLE 1

A sample of 10 observations: \(\bar X = 48,\; S = 5\). Test \(H_0: \mu = 50\) at 5 %.

\(t = (48 - 50)/(5/\sqrt{10}) = -2/1.581 = -1.265\). df = 9. \(t_{0.025, 9} = 2.262\). \(|t| < 2.262\) ⇒ do not reject \(H_0\).

EXAMPLE 2

10 students score: 65, 70, 68, 72, 75, 73, 71, 69, 74, 70 — \(\bar X = 70.7,\; S = 2.98\). Test \(H_0: \mu = 68\).

\(t = (70.7 - 68)/(2.98/\sqrt{10}) = 2.7/0.943 = 2.86\). df = 9. \(t_{0.025, 9} = 2.262\) ⇒ reject \(H_0\). Mean exceeds 68.

3. t-test for Difference of Two Means (Independent Samples)

\(H_0: \mu_1 = \mu_2\). With pooled variance:

\[ s_p^2 \;=\; \dfrac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1 + n_2 - 2}, \] \[ t \;=\; \dfrac{\bar X_1 - \bar X_2}{s_p\sqrt{\dfrac{1}{n_1} + \dfrac{1}{n_2}}} \;\sim\; t_{n_1+n_2-2}. \]

Assumption: \(\sigma_1 = \sigma_2\) (equal variances). Use Welch's correction otherwise.

Where the Two-sample t Statistic Comes From

Let \(x_1, \ldots, x_{n_1}\) be a random sample from \(N(\mu_1, \sigma_1^2)\) and \(y_1, \ldots, y_{n_2}\) an independent one from \(N(\mu_2, \sigma_2^2)\). Test \(H_0: \mu_1 = \mu_2\).

Step 1. Each mean is normal: \(\bar x \sim N(\mu_1, \sigma_1^2/n_1)\) and \(\bar y \sim N(\mu_2, \sigma_2^2/n_2)\). The samples are independent, so the variances of the two means add, and the difference is normal:

\[ \bar x - \bar y \sim N\!\left(\mu_1 - \mu_2,\; \frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2}\right). \]

Case 1: \(\sigma_1 = \sigma_2 = \sigma\), unknown. This is the \(t\)-test. Standardise the difference: \(\xi = \dfrac{\bar x - \bar y - (\mu_1 - \mu_2)}{\sigma\sqrt{1/n_1 + 1/n_2}} \sim N(0,1)\). With \(s_1^2, s_2^2\) the sample variances (divisor \(n\)),

\[ \frac{n_1 s_1^2}{\sigma^2} \sim \chi^2_{n_1 - 1}, \qquad \frac{n_2 s_2^2}{\sigma^2} \sim \chi^2_{n_2 - 1}, \]

independently, and by the additive property of \(\chi^2\) their sum is \(\chi^2 = \dfrac{n_1 s_1^2 + n_2 s_2^2}{\sigma^2} \sim \chi^2_{n_1 + n_2 - 2}\). Divide \(\xi\) by \(\sqrt{\chi^2/(n_1+n_2-2)}\), as the definition of \(t\) requires; \(\sigma\) cancels exactly as in §2:

\[ \begin{gathered} \begin{aligned} t &= \frac{\xi}{\sqrt{\chi^2/(n_1 + n_2 - 2)}} = \frac{\bar x - \bar y - (\mu_1 - \mu_2)}{\sqrt{\dfrac{n_1 s_1^2 + n_2 s_2^2}{n_1 + n_2 - 2}}\sqrt{\dfrac{1}{n_1} + \dfrac{1}{n_2}}} \\ &= \frac{\bar x - \bar y - (\mu_1 - \mu_2)}{S\sqrt{\dfrac{1}{n_1} + \dfrac{1}{n_2}}} \sim t_{n_1 + n_2 - 2}, \end{aligned} \qquad S^2 = \frac{n_1 s_1^2 + n_2 s_2^2}{n_1 + n_2 - 2} . \end{gathered} \]

Under \(H_0\) the term \(\mu_1 - \mu_2\) is zero: \(t = \dfrac{\bar x - \bar y}{S\sqrt{1/n_1 + 1/n_2}} \sim t_{n_1 + n_2 - 2}\); reject \(H_0\) if \(|t| > t_{\alpha,\, n_1 + n_2 - 2}\). Since \(n_1 s_1^2 = (n_1 - 1)S_1^2\), this \(S^2\) is the pooled \(s_p^2\) written above with the other divisor — the same number.

Case 2: \(\sigma_1 = \sigma_2 = \sigma\), known. The denominator of the normal variate is \(\sqrt{\sigma^2/n_1 + \sigma^2/n_2} = \sigma\sqrt{1/n_1 + 1/n_2}\), so under \(H_0\)

\[ z = \frac{\bar x - \bar y}{\sigma\sqrt{\dfrac{1}{n_1} + \dfrac{1}{n_2}}} \sim N(0,1). \]

Case 3: \(\sigma_1^2\) and \(\sigma_2^2\) both known. Standardise directly:

\[ z = \frac{\bar x - \bar y}{\sqrt{\dfrac{\sigma_1^2}{n_1} + \dfrac{\sigma_2^2}{n_2}}} \sim N(0,1) \quad\text{under } H_0 . \]

In Cases 2 and 3, reject \(H_0\) if \(|z| > z_\alpha\).

Why the F-test comes first. Case 1 assumes the two population variances are equal. So before applying it, it is theoretically desirable to test \(\sigma_1^2 = \sigma_2^2\) with the F-test of §8; Worked Problem 34 below does exactly that.

EXAMPLE 1

Method A: \(n_1 = 8,\; \bar X_1 = 75,\; s_1 = 5\). Method B: \(n_2 = 10,\; \bar X_2 = 70,\; s_2 = 6\). Test at 5 %.

\(s_p^2 = [7(25) + 9(36)]/16 = (175 + 324)/16 = 31.19;\;s_p = 5.59\).

\(t = 5/(5.59 \sqrt{1/8 + 1/10}) = 5/(5.59 \cdot 0.474) = 1.89\). df = 16. \(t_{0.025, 16} = 2.12\). \(|t| < 2.12\) ⇒ no significant difference.

EXAMPLE 2

Drug A: \(n_1 = 12,\bar X_1 = 25,\; s_1 = 2\). Drug B: \(n_2 = 14,\bar X_2 = 28,\; s_2 = 2.5\). Test \(H_0: \mu_A = \mu_B\) at 5 %.

\(s_p^2 = (11 \cdot 4 + 13 \cdot 6.25)/24 = 5.22\); \(s_p = 2.28\).

\(t = -3/(2.28\sqrt{1/12 + 1/14}) = -3/0.898 = -3.34\). df = 24, \(t_{0.025} = 2.06\) ⇒ reject \(H_0\).

4. Paired t-test (Dependent Samples)

Used when the two samples are paired (before–after, matched pairs, twin studies).

Let \(d_i = X_i - Y_i\) (paired difference) with mean \(\bar d\) and SD \(s_d\). Then

\[ t \;=\; \dfrac{\bar d - 0}{s_d/\sqrt n} \;\sim\; t_{n-1}. \]

Where the Paired Statistic Comes From

In paired data \((x_1, y_1), \ldots, (x_n, y_n)\) the two values in a pair belong to the same sample unit — the same patient before and after, the same cow on two foods. They are not independent, so the two-sample test of §3, which assumed independent samples, does not apply.

The way out is to work with one number per unit, the difference \(d_i = x_i - y_i\). The \(d_i\) are a single random sample, and \(H_0: \mu_1 = \mu_2\) becomes \(H_0: \mu_d = 0\). The single-mean test of §2 applied to the \(d_i\) is then the paired test:

\[ \bar d = \frac{1}{n}\sum d_i, \qquad s^2 = \frac{1}{n}\sum (d_i - \bar d)^2 = \frac{1}{n}\sum d_i^2 - \bar d^2, \] \[ t = \frac{\bar d}{s/\sqrt{n-1}} = \frac{\bar d}{S/\sqrt n} \sim t_{n-1}, \qquad S^2 = \frac{1}{n-1}\left[\sum d_i^2 - n\bar d^2\right]. \]

Keep the direction straight. With \(d = x - y\), "the second reading is higher" means \(\mu_d < 0\), so an increase from \(x\) to \(y\) is a lower-tailed test: reject \(H_0\) when \(t < -t_\alpha\). Getting this backwards is the commonest slip in paired problems; Worked Problems 12 and 14 below set it up carefully.

EXAMPLE 1 (Before–after)

Weights of 8 patients before and after a diet:

Before7278698085768274
After7076677883747972
d22222232

\(\bar d = 17/8 = 2.125;\; s_d = 0.354\). \(t = 2.125/(0.354/\sqrt 8) = 2.125/0.125 = 17.0\). df = 7, highly significant ⇒ reject \(H_0\): weights fell. (That the diet caused the fall needs a control group; a before–after design cannot show it.)

EXAMPLE 2

10 students' scores before and after a coaching: \(\bar d = 4.5,\; s_d = 5.2\). Test \(H_0: \mu_d = 0\).

\(t = 4.5/(5.2/\sqrt{10}) = 4.5/1.644 = 2.74\). df = 9. \(t_{0.025} = 2.26\) ⇒ reject \(H_0\); scores rose significantly after the coaching.

t-test for a Correlation Coefficient

Let \((x_1, y_1), \ldots, (x_n, y_n)\) be a random sample of size \(n\) from a bivariate normal population, with sample correlation coefficient \(r\) and population correlation \(\rho\). Test

\(H_0: \rho = 0\) (the variables are uncorrelated) against \(H_1: \rho \ne 0\).

Under \(H_0\),

\[ t = \frac{r}{\sqrt{\dfrac{1 - r^2}{n - 2}}} = \frac{r\sqrt{n-2}}{\sqrt{1 - r^2}} \sim t_{n-2} . \]

The \(n - 2\) degrees of freedom are those of the residual sum of squares in the regression of \(y\) on \(x\), where two constants (the intercept and the slope) are fitted. If \(|t| > t_{\alpha, n-2}\), reject \(H_0\).

Only for \(\rho = 0\). The statistic has the \(t_{n-2}\) distribution when \(\rho = 0\); for any other value of \(\rho\) the distribution of \(r\) is skewed. A hypothesis \(\rho = \rho_0 \ne 0\) is tested with Fisher's \(Z\)-transformation, in Unit 3.

Confidence limits. For a large sample a simple interval is \(r \pm z_{\alpha/2}\,\dfrac{1 - r^2}{\sqrt n}\), from the large-sample standard error of \(r\); Worked Problem 18 uses it and compares it with Fisher's interval.

5. χ² Test for Goodness of Fit

Tests whether observed frequencies fit a hypothesized distribution.

\[ \chi^2 \;=\; \sum_{i=1}^{k}\dfrac{(O_i - E_i)^2}{E_i} \;\sim\; \chi^2_{k - 1 - r}, \]

where \(k\) = number of categories, \(r\) = number of parameters estimated from data, \(O_i\) = observed, \(E_i\) = expected frequency. Reject \(H_0\) if \(\chi^2 > \chi^2_{\alpha, df}\).

Conditions: All \(E_i \ge 5\); if any are smaller, combine adjacent categories.

Conditions for the Validity of the χ² Test

For the \(\chi^2\) test of goodness of fit, and the test of independence of §6, to be valid:

  1. The sample observations should be independent.
  2. The constraints on the cell frequencies should be linear, for example \(\sum_i (A_i) = \sum_j (B_j) = N\) in a test of independence.
  3. The total frequency \(N\) should be reasonably large, say greater than 50.
  4. No theoretical (expected) cell frequency should be less than 5.

Pooling. If an expected frequency is less than 5, it is pooled with the preceding or succeeding frequency until the pooled frequency exceeds 5, and the degrees of freedom are reduced by the cells lost: if three frequencies are pooled into one, two degrees of freedom are subtracted. Estimated parameters. If parameters of the fitted distribution are estimated from the data, that number is subtracted as well. So with \(k\) classes, \(K\) degrees of freedom lost to pooling and \(l\) parameters estimated,

\[ \text{d.f.} = k - 1 - K - l . \]

Karl Pearson's Statistic and its Short Form

Karl Pearson's test asks whether the deviation of experiment from theory is just chance, or is due to the inadequacy of the theory to fit the observed data. With \(O_i\) the observed and \(E_i\) the expected frequencies, \(H_0\): the fitted distribution is a good fit,

\[ \chi^2 = \sum_{i=1}^{k}\frac{(O_i - E_i)^2}{E_i} \sim \chi^2_{k-1} . \]

The short form. Expand the square and use \(\sum O_i = \sum E_i = N\):

\[ \begin{aligned} \sum\frac{(O_i - E_i)^2}{E_i} &= \sum\frac{O_i^2}{E_i} - 2\sum O_i + \sum E_i = \sum\frac{O_i^2}{E_i} - 2N + N \\ &= \sum\frac{O_i^2}{E_i} - N . \end{aligned} \]

The short form needs only one division per class, which is why it is convenient by hand.

EXAMPLE 1 (Fair die)

Throw a die 60 times. Observed frequencies: 8, 11, 9, 12, 10, 10. Test fairness.

\(E_i = 60/6 = 10\) for each. \[ \begin{aligned} \chi^2 &= [(8-10)^2 + (11-10)^2 + (9-10)^2 + (12-10)^2 + 0 + 0]/10 \\ &= (4+1+1+4)/10 = 1.0 \end{aligned} \]. df = 5. \(\chi^2_{0.05,5} = 11.07\) ⇒ do not reject \(H_0\); the data are consistent with a fair die.

EXAMPLE 2 (Mendelian ratio 9:3:3:1)

Of 800 plants: 460 round-yellow, 140 round-green, 130 wrinkled-yellow, 70 wrinkled-green. Expected: 450, 150, 150, 50.

\[ \begin{aligned} \chi^2 &= (10)^2/450 + (10)^2/150 + (20)^2/150 + (20)^2/50 \\ &= 0.222 + 0.667 + 2.667 + 8.0 = 11.56 \end{aligned} \]. df = 3, \(\chi^2_{0.05,3} = 7.81\) ⇒ reject; data deviates from Mendelian ratio.

6. χ² Test for Independence (Contingency Tables)

Tests whether two categorical variables are independent.

For an \(r \times c\) contingency table with observed frequencies \(O_{ij}\):

\[ E_{ij} \;=\; \dfrac{(\text{row total}_i)(\text{col total}_j)}{N}, \] \[ \chi^2 \;=\; \sum_{i,j}\dfrac{(O_{ij} - E_{ij})^2}{E_{ij}} \;\sim\; \chi^2_{(r-1)(c-1)}. \]

Expected Frequencies Under Independence

Attribute A has \(r\) classes \(A_1, \ldots, A_r\) and B has \(s\) classes \(B_1, \ldots, B_s\). In the \(r \times s\) contingency table, \((A_iB_j)\) is the number of units with both \(A_i\) and \(B_j\), \((A_i)\) and \((B_j)\) are the margins, and \(\sum_i (A_i) = \sum_j (B_j) = N\).

Estimate the class probabilities by their proportions, \(P[A_i] = (A_i)/N\) and \(P[B_j] = (B_j)/N\). Under \(H_0\) the attributes are independent, so the probability of a cell is the product:

\[ P[A_iB_j] = P[A_i]\,P[B_j] = \frac{(A_i)}{N}\cdot\frac{(B_j)}{N} . \]

Multiplying by \(N\) gives the expected frequency,

\[ E_{ij} = N\,P[A_iB_j] = \frac{(A_i)(B_j)}{N}, \qquad \chi^2 = \sum_{i=1}^{r}\sum_{j=1}^{s}\frac{(O_{ij} - E_{ij})^2}{E_{ij}} \sim \chi^2_{(r-1)(s-1)} . \]

The degrees of freedom are \((r-1)(s-1)\): once the margins are fixed, only that many cells can be filled freely; the rest follow by subtraction.

The 2 × 2 Shortcut, Proved

Statement. For the table with cells \(a, b\) (first row) and \(c, d\) (second row), \(N = a + b + c + d\),

\[ \chi^2 = \frac{N(ad - bc)^2}{(a+b)(c+d)(a+c)(b+d)} . \]

Proof. The margins are \(a+b\), \(c+d\) (rows) and \(a+c\), \(b+d\) (columns), so the expected frequencies are

\[ \begin{gathered} E_{11} = \frac{(a+b)(a+c)}{N} ,\quad E_{12} = \frac{(a+b)(b+d)}{N} ,\quad E_{21} = \frac{(c+d)(a+c)}{N}, \\ E_{22} = \frac{(c+d)(b+d)}{N} . \end{gathered} \]

Step 1: every deviation has the same size. Put \(a\) over the common denominator \(N\) and expand:

\[ \begin{aligned} a - E_{11} &= \frac{a(a+b+c+d) - (a+b)(a+c)}{N} \\ &= \frac{a^2 + ab + ac + ad - a^2 - ac - ab - bc}{N} = \frac{ad - bc}{N} . \end{aligned} \]

The same expansion gives \(b - E_{12} = -\dfrac{ad - bc}{N}\), \(c - E_{21} = -\dfrac{ad - bc}{N}\) and \(d - E_{22} = \dfrac{ad - bc}{N}\). Squared, all four are \(\dfrac{(ad - bc)^2}{N^2}\).

Step 2: take the common factor out.

\[ \chi^2 = \frac{(ad - bc)^2}{N^2}\left[\frac{1}{E_{11}} + \frac{1}{E_{12}} + \frac{1}{E_{21}} + \frac{1}{E_{22}}\right]. \]

Each \(E\) has \(N\) in its denominator, so each \(1/E\) has \(N\) on top, and one \(N\) cancels against the \(N^2\):

\[ \begin{aligned} \chi^2 = \frac{(ad - bc)^2}{N}\bigg[&\frac{1}{(a+b)(a+c)} + \frac{1}{(a+b)(b+d)} \\ &+ \frac{1}{(c+d)(a+c)} + \frac{1}{(c+d)(b+d)}\bigg]. \end{aligned} \]

Step 3: add the four fractions. Pair the first two, which share \((a+b)\): \(\dfrac{1}{a+b}\left[\dfrac{1}{a+c} + \dfrac{1}{b+d}\right] = \dfrac{1}{a+b}\cdot\dfrac{N}{(a+c)(b+d)}\), because \((b+d) + (a+c) = N\). The last two give \(\dfrac{1}{c+d}\cdot\dfrac{N}{(a+c)(b+d)}\) the same way. Adding,

\[ \begin{aligned} \frac{N}{(a+c)(b+d)}\left[\frac{1}{a+b} + \frac{1}{c+d}\right] &= \frac{N}{(a+c)(b+d)}\cdot\frac{N}{(a+b)(c+d)} \\ &= \frac{N^2}{(a+b)(c+d)(a+c)(b+d)} . \end{aligned} \]

Step 4. Substitute into Step 2: \(\chi^2 = \dfrac{(ad - bc)^2}{N}\cdot\dfrac{N^2}{(a+b)(c+d)(a+c)(b+d)} = \dfrac{N(ad - bc)^2}{(a+b)(c+d)(a+c)(b+d)}\). □

Yates' Correction

In a \(2 \times 2\) table, when a cell frequency is small (an expected frequency below 5), the continuity correction is

\[ \chi^2 = \frac{N\left(|ad - bc| - \tfrac{N}{2}\right)^2}{(a+b)(c+d)(a+c)(b+d)} . \]

The \(\chi^2\) distribution is continuous and the cell counts are whole numbers; subtracting \(N/2\) moves each deviation half a unit towards zero, which makes the approximation better for small counts. Many courses use the correction even when no expected frequency is below 5, and the reason Extra Practical Problem 7 below applies it.

EXAMPLE 1 (2 × 2 table)

Smoking vs cancer in 200 people:

CancerNoTotal
Smoker6040100
Non-smoker2080100
Total80120200

Expected: \(E_{11} = 100 \cdot 80/200 = 40\); rest by subtraction: \(E_{12} = 60,\; E_{21} = 40,\; E_{22} = 60\).

\[ \begin{aligned} \chi^2 &= (60-40)^2/40 + (40-60)^2/60 + (20-40)^2/40 + (80-60)^2/60 \\ &= 10 + 6.667 + 10 + 6.667 = 33.33 \end{aligned} \]. df = 1, \(\chi^2_{0.05,1} = 3.84\) ⇒ reject; smoking and cancer are not independent.

EXAMPLE 2 (3 × 2 table)

Voting preference of 200 voters in three regions, between two candidates:

Candidate ACandidate BTotal
Region 1251540
Region 2273360
Region 36832100
Total12080200

Expected counts, row total × column total / 200: Region 1: \(40 \cdot 120/200 = 24\) and 16; Region 2: 36 and 24; Region 3: 60 and 40.

\[ \begin{aligned} \chi^2 &= \dfrac{(25-24)^2}{24} + \dfrac{(15-16)^2}{16} + \dfrac{(27-36)^2}{36} + \dfrac{(33-24)^2}{24} \\ &\quad + \dfrac{(68-60)^2}{60} + \dfrac{(32-40)^2}{40} \end{aligned} \] \(= 0.042 + 0.063 + 2.250 + 3.375 + 1.067 + 1.600 = 8.40\).

df = (3−1)(2−1) = 2, \(\chi^2_{0.05,2} = 5.99\). Since \(8.40 > 5.99\), reject (p ≈ 0.015): preference depends on region. Region 2, where B is ahead, contributes most of the statistic.

7. χ² Test for Single Variance

\(H_0: \sigma^2 = \sigma_0^2\). Test statistic:

\[ \chi^2 \;=\; \dfrac{(n - 1) S^2}{\sigma_0^2} \;\sim\; \chi^2_{n-1}. \]

Where the Single-variance Statistic Comes From

For a random sample from \(N(\mu, \sigma^2)\) with sample variance \(s^2\) (divisor \(n\)), \(\dfrac{n s^2}{\sigma^2} = \dfrac{\sum (x_i - \bar x)^2}{\sigma^2} \sim \chi^2_{n-1}\). Under \(H_0: \sigma^2 = \sigma_0^2\),

\[ \chi_0^2 = \frac{n s^2}{\sigma_0^2} = \frac{(n-1)S^2}{\sigma_0^2} \sim \chi^2_{n-1}, \]

the second form being the one above, since \(n s^2 = (n-1)S^2\) (§1). The rule "reject if \(\chi_0^2 > \chi^2_{\alpha, n-1}\)" is the test against \(\sigma^2 > \sigma_0^2\). Against \(\sigma^2 < \sigma_0^2\) the rejection region is the lower tail, and against \(\sigma^2 \ne \sigma_0^2\) it is both tails, as Example 1 below uses.

EXAMPLE 1

Sample of 25 with \(S^2 = 18\). Test \(H_0: \sigma^2 = 16\) at 5 %.

\(\chi^2 = 24 \cdot 18/16 = 27\). df = 24. \(\chi^2_{0.025, 24} = 39.36;\; \chi^2_{0.975, 24} = 12.40\). Since \(12.4 < 27 < 39.4\) ⇒ do not reject \(H_0\).

EXAMPLE 2

\(n = 21,\; S^2 = 6\). Test \(H_0: \sigma^2 = 4\) (one-tailed: \(\sigma^2 > 4\)).

\(\chi^2 = 20 \cdot 6/4 = 30\). df = 20. \(\chi^2_{0.05, 20} = 31.41 > 30\) ⇒ do not reject \(H_0\) at 5 %.

8. F-test for Equality of Two Variances

\(H_0: \sigma_1^2 = \sigma_2^2\). Take the ratio of larger to smaller variance:

\[ F \;=\; \dfrac{S_1^2}{S_2^2} \;\sim\; F_{n_1 - 1,\; n_2 - 1}\;\;(S_1^2 \ge S_2^2). \]

Reject \(H_0\) if \(F > F_{\alpha, n_1-1, n_2-1}\) (one-tailed) or beyond two-tailed bounds.

Where the F Statistic Comes From

Let a sample of size \(n_1\) come from \(N(\mu_1, \sigma_1^2)\) and an independent one of size \(n_2\) from \(N(\mu_2, \sigma_2^2)\), with sample variances \(s_1^2, s_2^2\). Then

\[ \frac{n_1 s_1^2}{\sigma_1^2} \sim \chi^2_{n_1 - 1}, \qquad \frac{n_2 s_2^2}{\sigma_2^2} \sim \chi^2_{n_2 - 1}, \]

independently. By definition, the ratio of two independent \(\chi^2\) variates, each divided by its degrees of freedom, is an \(F\) variate:

\[ F = \frac{\dfrac{n_1 s_1^2}{\sigma_1^2}\Big/(n_1 - 1)}{\dfrac{n_2 s_2^2}{\sigma_2^2}\Big/(n_2 - 1)} \sim F_{(n_1 - 1,\; n_2 - 1)} . \]

Under \(H_0: \sigma_1^2 = \sigma_2^2\) the population variances cancel, leaving the ratio of the unbiased estimates \(S_1^2 = \dfrac{n_1 s_1^2}{n_1 - 1}\) and \(S_2^2 = \dfrac{n_2 s_2^2}{n_2 - 1}\):

\[ F = \frac{S_1^2}{S_2^2} \sim F_{(n_1 - 1,\; n_2 - 1)} . \]

Which Variance Goes on Top

F tables give only upper points, so the larger estimate is put in the numerator and the degrees of freedom follow it:

Reject \(H_0\) if \(F\) exceeds the table value. One caution: putting the larger estimate on top makes a two-sided alternative \(\sigma_1^2 \ne \sigma_2^2\) a two-tailed test in disguise, so at an exact 5% level the upper 2.5% point is the right comparison. The 5% table is often read by convention; the problems below say where the difference could matter.

An F-test also states its question in terms of the unbiased estimates \(S^2\). If a problem already gives unbiased estimates, they are used as they stand — converting them again by \(n/(n-1)\) would inflate both (Worked Problem 33).

EXAMPLE 1

\(n_1 = 11,\; S_1^2 = 25;\;\; n_2 = 16,\; S_2^2 = 16\). Test at 5 %.

\(F = 25/16 = 1.5625\). df = (10, 15). \(F_{0.05, 10, 15} = 2.54\) ⇒ do not reject \(H_0\); no evidence that the variances differ.

EXAMPLE 2

Two production lines: \(S_1^2 = 36\) (n₁=21), \(S_2^2 = 16\) (n₂=16). \(F = 36/16 = 2.25\). df = (20, 15). \(F_{0.05} = 2.33\) ⇒ do not reject \(H_0\) at 5 %.

9. Choosing the Right Small-sample Test

QuestionTest
Single mean (σ known, any n)z, standard normal
Single mean (σ unknown)t with n−1 df
Difference of two means (independent)Pooled t with n₁+n₂−2 df
Difference of paired meansPaired t with n−1 df
Correlation coefficient (ρ = 0)t with n−2 df
Population varianceχ² with n−1 df
Equality of two variancesF with (n₁−1, n₂−1) df
Goodness of fit / independenceχ² with appropriate df

Key Take-aways

Extra Practical Problems

PRACTICE

Additional worked problems with step-by-step procedures to support self-study, matching this unit's topics.

STEP-BY-STEP PROCEDURE (general test of significance)
  1. State the null hypothesis \(H_0\) and alternative hypothesis \(H_1\) (one- or two-sided).
  2. Choose the level of significance \(\alpha\) (usually 5% or 1%).
  3. Compute the appropriate test statistic from the sample.
  4. Find the degrees of freedom and read the table (critical) value at \(\alpha\).
  5. Decide: if \(|\text{calculated}| > \text{tabulated}\), reject \(H_0\); otherwise do not reject \(H_0\). State the conclusion in terms of \(H_0\).

Test statistics used in this unit

Problem 1 — t-test for a Single Mean

DATA

A new greengram variety is expected to yield 12 q/ha. Tested on 10 fields: 14.3, 12.6, 13.7, 10.9, 13.7, 12.0, 11.4, 12.0, 12.6, 13.1.

\(H_0: \mu = 12\) vs \(H_1: \mu \ne 12\). Sample mean \(\bar x = 12.63\), \(s = \sqrt{\frac{\sum(x-\bar x)^2}{n-1}} = \sqrt{\frac{10.60}{9}} = 1.085\).

\(t = \dfrac{\bar x - \mu}{s/\sqrt n} = \dfrac{12.63 - 12}{1.085/\sqrt{10}} = 1.836\), df = 9. Table \(t_{0.025,9} = 2.262\) (two-tailed 5%). Since \(1.836 < 2.262\), do not reject \(H_0\) — the data are consistent with a yield of 12 q/ha.

Problem 2 — t-test for Two Independent Sample Means

DATA

Yields (q) under two manures: Manure I (n=8): 14, 20, 34, 48, 32, 42, 30, 44; Manure II (n=7): 31, 18, 22, 28, 40, 26, 45.

\(\bar x = 33,\ \bar y = 30\); \(\sum(x-\bar x)^2 = 968,\ \sum(y-\bar y)^2 = 554\).

\(s^2 = \dfrac{968 + 554}{8+7-2} = 117.07\), \(s = 10.82\).

\(t = \dfrac{\bar x - \bar y}{s\sqrt{\frac1{n_1}+\frac1{n_2}}} = \dfrac{33-30}{10.82\sqrt{\frac18+\frac17}} = 0.54\), df = 13. Table \(t_{0.025,13} = 2.16\). Since \(0.54 < 2.16\), do not reject \(H_0\) — no significant difference between the manures.

Problem 3 — Paired t-test

DATA

Body-weight increase (oz) of animals given treatments A and B from six litters:

Litter123456
A283229362934
B252427303029

Differences \(d = A - B\): 3, 8, 2, 6, −1, 5; \(\bar d = 23/6 = 3.83\), \(s^2 = \frac{50.83}{5} = 10.17\), \(s = 3.19\).

\(t = \dfrac{\bar d}{s/\sqrt n} = \dfrac{3.83}{3.19/\sqrt 6} = 2.94\), df = 5. Table \(t_{0.025,5} = 2.571\). Since \(2.94 > 2.571\), reject \(H_0\) — treatments A and B differ significantly.

Problem 4 — F-test (Variance-Ratio Test)

DATA

Sample I (n=10): 20, 16, 26, 27, 23, 22, 18, 24, 25, 19. Sample II (n=12): 17, 23, 32, 25, 22, 24, 28, 18, 31, 33, 20, 27.

\(\bar x = 22,\ \bar y = 25\); \(s_1^2 = \frac{120}{9} = 13.33\), \(s_2^2 = \frac{314}{11} = 28.55\).

\(F = \dfrac{\text{larger } s^2}{\text{smaller } s^2} = \dfrac{28.55}{13.33} = 2.14\), df = (11, 9). Table \(F_{0.05}(11, 9) = 3.10\). Since \(2.14 < 3.10\), do not reject \(H_0\) — no evidence that the variances differ.

Problem 5 — Chi-square Goodness of Fit

DATA

200 random digits with observed frequencies of 0–9: 22, 21, 16, 20, 23, 15, 18, 21, 19, 25. Expected frequency \(= 200/10 = 20\) each.

\(\chi^2 = \sum\dfrac{(O_i - E_i)^2}{E_i} = \dfrac{86}{20} = 4.3\), df = 9. Table \(\chi^2_{0.05,9} = 16.92\). Since \(4.3 < 16.92\), do not reject \(H_0\) — the data are consistent with equally frequent digits.

Problem 6 — Chi-square for a 2×2 Table

DATA

Cholera epidemic data:

AttackedNot attackedTotal
Inoculated31469500
Not inoculated18513151500
Total21617842000

Expected: E(31)=54, E(469)=446, E(185)=162, E(1315)=1338. \(\chi^2 = \sum\dfrac{(O-E)^2}{E} = 14.64\), df = (2−1)(2−1) = 1. Table \(\chi^2_{0.05,1} = 3.841\). Since \(14.64 > 3.841\), reject \(H_0\) — attack is associated with inoculation: 6.2% of the inoculated were attacked against 12.3% of the others.

Problem 7 — Chi-square with Yates' Correction (small cell frequency)

DATA

50 small shops:

In TownsIn VillagesTotal
Run by men171835
Run by women31215
Total203050

The counts are small (one observed cell is 3; the smallest expected count is \(15 \times 20/50 = 6\)), and many texts apply Yates' correction to every 2×2 table, so it is applied here: \(\chi^2 = \dfrac{N\left(|ad-bc| - \frac N2\right)^2}{(a+b)(c+d)(a+c)(b+d)} = \dfrac{50\left(|17\cdot12 - 18\cdot3| - 25\right)^2}{35\cdot15\cdot20\cdot30} = 2.48\), df = 1. Since \(2.48 < 3.841\), do not reject \(H_0\) — no evidence of relatively more women owners in villages. (Without the correction \(\chi^2 = 3.57\), which also does not reach 3.841.)

Unsolved Exercises

PRACTICE
  1. Marks of 6 boys 63, 63, 64, 66, 60, 68; test whether mean = 66. (Ans: \(t_{cal} = -1.78\))
  2. Onion yield: Method I (n=12, mean 25.25, SS 186.25) vs Method II (n=12, mean 28.83, SS 737.67). (Ans: \(t_{cal} = -1.35\))
  3. Blood-pressure changes d = 5, 2, 8, −1, 3, 0, −2, 1, 5, 0, 4; paired test for an increase. (Ans: \(\bar d = 2.27,\ s_d = 3.04,\ t_{cal} = 2.48\), df = 10)
  4. Output A: 40,30,38,41,38,35; B: 39,38,41,23,32,39,40,34. Is B more stable (F-test)? (Ans: \(s_1^2 = 16,\ s_2^2 = 35.93\) (both with \(n-1\)); \(F = 35.93/16 = 2.25\), df = (7, 5), below \(F_{0.05}(7,5) = 4.88\): not significant, so the data do not show either line to be more stable, although A's sample variance is the smaller)
  5. Anesthetic mortality: Local 511 alive/24 dead, General 147/18. \(\chi^2\) test. (Ans: \(\chi^2_{cal} = 9.22\))
  6. Serum on 22 animals: Inoculated 7 rec/3 died, Uninoculated 3/9. \(\chi^2\) test of association. (Ans: \(\chi^2_{cal} = 2.82\) with Yates' correction; 4.45 without)

Worked Problems on Small Sample Tests

Thirty-four problems, grouped by the test they use: five on a single mean, six on two independent means, four on paired samples, three on a correlation coefficient, six on goodness of fit, five on independence of attributes and five on the F-test. They are numbered 1–34 separately from the seven Extra Practical Problems above, and the rest of this page calls them “Worked Problem n”. Every one runs the same steps: null hypothesis, alternative hypothesis, test statistic under \(H_0\), conclusion at the stated level (5% where none is stated). The \(\chi^2\) test for a single variance (§7) is used in the Extra Practical Problems above.

These solutions write \(s^2\) for the sample variance with divisor \(n\) and \(S^2\) for the one with divisor \(n-1\); the two forms of each statistic give the same number (§1). Values are carried at full precision and rounded only when written.

A. t-test for a Single Mean

WORKED PROBLEM 1 — cement bags, σ known

Bags of cement should weigh 24 kg on average, with standard deviation 2.4 kg. A sample of 16 bags has mean weight 23.1 kg. Is the difference significant?

Given \(\mu_0 = 24\), \(\sigma = 2.4\), \(n = 16\), \(\bar x = 23.1\).

(1) Null hypothesis. \(H_0: \mu = 24\): the bags meet the specification.

(2) Alternative hypothesis. \(H_1: \mu \ne 24\). Two-tailed test.

(3) Test statistic under \(H_0\). The population standard deviation is known, so by Case 1 of §2 the normal test applies even though the sample is small:

\[ z = \frac{\bar x - \mu_0}{\sigma/\sqrt n} = \frac{23.1 - 24}{2.4/\sqrt{16}} = \frac{-0.9}{0.6} = -1.5 . \]

(4) Conclusion. \(|z| = 1.5\), and the two-tailed 5% value is \(z_\alpha = 1.96\). Since \(|z| < z_\alpha\), \(H_0\) is not rejected: the difference is not significant.

WORKED PROBLEM 2 — pipes from a workshop

Pipes from a workshop should have mean outer diameter 50 mm. A sample of 17 pipes has mean 52.1 mm and standard deviation 3.2 mm. Can the sample be regarded as coming from this population, at the 5% level?

Given \(\mu_0 = 50\), \(n = 17\), \(\bar x = 52.1\), \(s = 3.2\); \(\sigma\) is unknown.

(1) \(H_0: \mu = 50\). (2) \(H_1: \mu \ne 50\). Two-tailed.

(3)

\[ t = \frac{\bar x - \mu_0}{s/\sqrt{n-1}} = \frac{52.1 - 50}{3.2/\sqrt{16}} = \frac{2.1}{0.8} = 2.625 \sim t_{16} . \]

The two-tailed 5% value for 16 d.f. is \(t_{0.025,16} = 2.12\).

(4) \(|t| = 2.625 > 2.12\), so \(H_0\) is rejected: the sample does not come from a population with mean 50 mm.

−2.120 2.120 t = 2.63 t = 0 μ = 50 in the rejection region → reject H₀ ±t = ±2.120, 16 d.f.
Fig 4.2 — Worked Problem 2. The statistic 2.625 is past 2.12, so the pipes are judged not to come from a population with mean 50 mm.
WORKED PROBLEM 3 — tile thickness, one-tailed at 1%

Floor tiles are specified at 4.2 mm thick. A sample of 10 tiles has mean 4.32 mm and standard deviation 0.11 mm. Test at the 1% level whether the mean thickness is more than 4.2 mm.

(1) \(H_0: \mu = 4.2\). (2) \(H_1: \mu > 4.2\). One-tailed (right).

(3)

\[ t = \frac{4.32 - 4.2}{0.11/\sqrt 9} = \frac{0.12}{0.03667} = 3.273 \sim t_9 . \]

The one-tailed 1% value for 9 d.f. is \(t_{0.01,9} = 2.821\).

(4) \(t = 3.273 > 2.821\), so \(H_0\) is rejected: the mean thickness is more than 4.2 mm.

2.821 t = 3.27 t = 0 μ = 4.2 in the rejection region → reject H₀ t = 2.821, 9 d.f.
Fig 4.3 — Worked Problem 3. A right-tailed test at 1%: only the upper 1% is shaded, and t = 3.27 lies in it.
WORKED PROBLEM 4 — scores of ten trainees

The scores of 10 trainees on an aptitude test are 45, 58, 52, 39, 61, 47, 50, 44, 55, 41. Do the data support a population mean score of 50?

\(x\)45585239614750445541\(\sum x = 492\)
\(x^2\)2025336427041521372122092500193630251681\(\sum x^2 = 24686\)
\[ \begin{gathered} \bar x = \frac{492}{10} = 49.2, \qquad s^2 = \frac{\sum x^2}{n} - \bar x^2 = 2468.6 - 2420.64 = 47.96, \\ s = 6.9253 . \end{gathered} \]

(1) \(H_0: \mu = 50\). (2) \(H_1: \mu \ne 50\). Two-tailed.

(3)

\[ t = \frac{49.2 - 50}{6.9253/\sqrt 9} = \frac{-0.8}{2.3084} = -0.347 \sim t_9 . \]

The two-tailed 5% value for 9 d.f. is 2.262.

(4) \(|t| = 0.347 < 2.262\), so \(H_0\) is not rejected: the data are consistent with a population mean of 50.

WORKED PROBLEM 5 — weights below 55 kg? with confidence limits

The weights (kg) of 10 women are 54, 57, 59, 56, 52, 58, 60, 55, 57, 62. Test whether the average weight is below 55 kg, and find 95% and 99% confidence limits for the population mean.

\(x\)54575956525860555762\(\sum x = 570\)
\(x^2\)2916324934813136270433643600302532493844\(\sum x^2 = 32568\)
\[ \bar x = 57, \qquad s^2 = 3256.8 - 57^2 = 7.8, \qquad s = 2.7928 . \]

(1) \(H_0: \mu = 55\). (2) \(H_1: \mu < 55\). One-tailed (left): \(H_0\) is rejected only if \(t < -t_{0.05,9} = -1.833\).

(3)

\[ t = \frac{57 - 55}{2.7928/\sqrt 9} = \frac{2}{0.9309} = 2.148 \sim t_9 . \]

(4) The statistic is positive. A left-tailed test can reject only a large negative \(t\); \(t = +2.15\) is in the opposite tail, so \(H_0\) is not rejected: the data give no evidence that the average weight is below 55 kg. They could not: the sample mean, 57, is above 55. Comparing \(|t|\) with 1.833 and rejecting would ignore the direction of the alternative.

−1.833 t = 2.15 t = 0 μ = 55 outside the rejection region → do not reject H₀ t = −1.833, 9 d.f.
Fig 4.4 — Worked Problem 5. The alternative μ < 55 puts the whole rejection region in the left tail. The statistic is +2.15, on the other side of the centre, so H₀ stands.

Confidence limits. An interval has two ends, so it uses the two-tailed points (§2). With \(s/\sqrt{n-1} = 0.9309\):

\[ \text{95\%:}\quad 57 \pm 2.262(0.9309) = 57 \pm 2.11 \;\Rightarrow\; (54.89,\; 59.11), \] \[ \text{99\%:}\quad 57 \pm 3.250(0.9309) = 57 \pm 3.03 \;\Rightarrow\; (53.97,\; 60.03). \]

Using the one-tailed points (1.833 and 2.821) here would give 90% and 98% intervals, not 95% and 99%.

B. t-test for the Difference of Two Means

WORKED PROBLEM 6 — population variances known

Two samples of sizes 12 and 9 have means 41 and 44. The population variances are 9.6 and 8.1. Is the difference of means significant?

(1) \(H_0: \mu_1 = \mu_2\). (2) \(H_1: \mu_1 \ne \mu_2\). Two-tailed.

(3) Both population variances are known, so Case 3 of §3 applies, small samples included:

\[ z = \frac{\bar x - \bar y}{\sqrt{\dfrac{\sigma_1^2}{n_1} + \dfrac{\sigma_2^2}{n_2}}} = \frac{41 - 44}{\sqrt{\dfrac{9.6}{12} + \dfrac{8.1}{9}}} = \frac{-3}{\sqrt{0.8 + 0.9}} = \frac{-3}{1.3038} = -2.301 . \]

(4) \(|z| = 2.3 > 1.96\), so \(H_0\) is rejected: the population means differ.

−1.96 1.96 z = −2.3 z = 0 μ₁ = μ₂ in the rejection region → reject H₀ ±zα = ±1.96
Fig 4.5 — Worked Problem 6. The population variances are known, so the normal curve applies to these small samples; z = −2.3 is beyond −1.96.
WORKED PROBLEM 7 — same population with SD 4? at 1%

Samples of sizes 11 and 14 have means 37 and 41.6. Test at the 1% level whether they can be regarded as coming from the same population with standard deviation 4.

(1) \(H_0: \mu_1 = \mu_2\). (2) \(H_1: \mu_1 \ne \mu_2\). Two-tailed.

(3) A common, known \(\sigma = 4\): Case 2 of §3.

\[ z = \frac{37 - 41.6}{4\sqrt{\dfrac{1}{11} + \dfrac{1}{14}}} = \frac{-4.6}{4(0.4029)} = -2.854 . \]

(4) At 1%, two-tailed, \(z_\alpha = 2.58\). \(|z| = 2.85 > 2.58\), so \(H_0\) is rejected: the samples are not from the same population.

−2.58 2.58 z = −2.85 z = 0 μ₁ = μ₂ in the rejection region → reject H₀ ±zα = ±2.58
Fig 4.6 — Worked Problem 7. At 1% the critical values move out to ±2.58; z = −2.85 still clears them.
WORKED PROBLEM 8 — wages in two units

Unit A: 11 workers, mean daily wage ₹2430, standard deviation ₹85. Unit B: 13 workers, mean ₹2350, standard deviation ₹92. Do the mean wages differ?

The population standard deviations are unknown, so the \(t\)-test (Case 1 of §3).

\[ \begin{gathered} S^2 = \frac{n_1 s_1^2 + n_2 s_2^2}{n_1 + n_2 - 2} = \frac{11(85)^2 + 13(92)^2}{22} = \frac{79475 + 110032}{22} = 8613.95, \\ S = 92.8114 . \end{gathered} \]

(1) \(H_0: \mu_1 = \mu_2\). (2) \(H_1: \mu_1 \ne \mu_2\). Two-tailed.

(3)

\[ t = \frac{2430 - 2350}{92.8114\sqrt{\dfrac{1}{11} + \dfrac{1}{13}}} = \frac{80}{92.8114(0.4097)} = 2.104 \sim t_{22} . \]

The two-tailed 5% value for 22 d.f. is 2.074.

(4) \(|t| = 2.104 > 2.074\), so \(H_0\) is rejected: the mean wages differ significantly.

−2.074 2.074 t = 2.1 t = 0 μ₁ = μ₂ in the rejection region → reject H₀ ±t = ±2.074, 22 d.f.
Fig 4.7 — Worked Problem 8. A narrow verdict: the statistic is just inside the right rejection region.
WORKED PROBLEM 9 — two makes of tyre, one-tailed at 1%

Make I: 9 tyres tested, mean life 42.0 thousand km, standard deviation 2.4. Make II: 8 tested, mean 36.5, standard deviation 2.9. Is make I better, at the 1% level?

The population standard deviations are unknown, so the \(t\)-test (Case 1 of §3).

\[ S^2 = \frac{n_1 s_1^2 + n_2 s_2^2}{n_1 + n_2 - 2} = \frac{9(2.4)^2 + 8(2.9)^2}{15} = \frac{51.84 + 67.28}{15} = 7.94, \qquad S = 2.818 . \]

(1) \(H_0: \mu_1 = \mu_2\). (2) \(H_1: \mu_1 > \mu_2\). One-tailed (right).

(3)

\[ t = \frac{42.0 - 36.5}{2.818\sqrt{\dfrac{1}{9} + \dfrac{1}{8}}} = \frac{5.5}{2.818(0.4859)} = 4.017 \sim t_{15} . \]

The one-tailed 1% value for 15 d.f. is 2.602.

(4) \(t = 4.017 > 2.602\), so \(H_0\) is rejected: make I is better.

2.602 t = 4.02 → off the scale t = 0 μ₁ = μ₂ in the rejection region → reject H₀ t = 2.602, 15 d.f.
Fig 4.8 — Worked Problem 9. A right-tailed test at 1%. The statistic lies far beyond the drawable range, so the marker sits at the edge.
WORKED PROBLEM 10 — two small samples from the raw data

Two independent samples of sizes 8 and 7 gave the values below. Is the difference of means significant?

\(x\)2325212724262224\(\sum x = 192,\ \sum x^2 = 4636\)
\(y\)22242025232124\(\sum y = 159,\ \sum y^2 = 3631\)
\[ \begin{gathered} \bar x = \frac{192}{8} = 24, \quad \bar y = \frac{159}{7} = 22.7143, \quad s_1^2 = \frac{4636}{8} - \bar x^2 = 3.5, \\ s_2^2 = \frac{3631}{7} - \bar y^2 = 2.7755 . \end{gathered} \] \[ S^2 = \frac{8(3.5) + 7(2.7755)}{13} = 3.6484, \qquad S = 1.9101 . \]

(1) \(H_0: \mu_1 = \mu_2\). (2) \(H_1: \mu_1 \ne \mu_2\). Two-tailed.

(3)

\[ t = \frac{24 - 22.7143}{1.9101\sqrt{\dfrac1{8} + \dfrac1{7}}} = \frac{1.2857}{0.9886} = 1.301 \sim t_{13} . \]

The two-tailed 5% value for 13 d.f. is 2.16.

(4) \(|t| = 1.301 < 2.16\), so \(H_0\) is not rejected: the difference of means is not significant.

−2.160 2.160 t = 1.3 t = 0 μ₁ = μ₂ outside the rejection region → do not reject H₀ ±t = ±2.160, 13 d.f.
Fig 4.9 — Worked Problem 10. The statistic sits inside the acceptance region.
WORKED PROBLEM 11 — are hockey players taller than footballers?

Heights (cm) of 6 hockey players and 10 footballers are given. Test at 5% whether hockey players are taller on average.

\(x\)170173176178180181\(\sum x = 1058,\ \sum x^2 = 186650\)
\(y\)168170172174176177178179181183\(\sum y = 1758,\ \sum y^2 = 309264\)
\[ \begin{gathered} \bar x = \frac{1058}{6} = 176.3333, \quad \bar y = \frac{1758}{10} = 175.8, \quad s_1^2 = \frac{186650}{6} - \bar x^2 = 14.8889, \\ s_2^2 = \frac{309264}{10} - \bar y^2 = 20.76 . \end{gathered} \] \[ S^2 = \frac{6(14.8889) + 10(20.76)}{14} = 21.2095, \qquad S = 4.6054 . \]

(1) \(H_0: \mu_1 = \mu_2\). (2) \(H_1: \mu_1 > \mu_2\). One-tailed (right).

(3)

\[ t = \frac{176.3333 - 175.8}{4.6054\sqrt{\dfrac1{6} + \dfrac1{10}}} = \frac{0.5333}{2.3782} = 0.224 \sim t_{14} . \]

The one-tailed 5% value for 14 d.f. is 1.761.

(4) \(t = 0.224 < 1.761\), so \(H_0\) is not rejected: the data do not show that hockey players are taller on average.

C. Paired t-test

WORKED PROBLEM 12 — reading speed before and after a course

Ten clerks took a speed-reading course. Their reading speeds (words per minute) before (\(x\)) and after (\(y\)) are below. Has the course increased reading speed?

Before \(x\)210198225240205215230220200212
After \(y\)218205224252210222233231204215
\(d = x - y\)−8−71−12−5−7−3−11−4−3

The same subjects are measured twice, so the samples are paired.

\[ \sum d = −59, \qquad \sum d^2 = 487, \qquad \bar d = \frac{-59}{10} = -5.9, \] \[ s^2 = \frac{487}{10} - \bar d^2 = 48.7 - 34.81 = 13.89, \qquad s = 3.7269 . \]

(1) \(H_0: \mu_1 = \mu_2\): the course does not change speed. (2) \(H_1: \mu_1 < \mu_2\): speed is higher after. With \(d = x - y\), that means \(\mu_d < 0\): one-tailed, left.

(3)

\[ t = \frac{\bar d}{s/\sqrt{n-1}} = \frac{-5.9}{3.7269/\sqrt{9}} = \frac{-5.9}{1.2423} = -4.749 \sim t_{9} . \]

(4) The left-tailed point is \(-1.833\); \(t = -4.749\) is below it, so \(H_0\) is rejected: reading speed has increased after the course.

−1.833 t = −4.75 off the scale t = 0 μ₁ = μ₂ in the rejection region → reject H₀ t = −1.833, 9 d.f.
Fig 4.10 — Worked Problem 12. With d = before − after, an increase makes d̄ negative, so the test is left-tailed, and the statistic lies in that tail.
WORKED PROBLEM 13 — pulse rate after a dose of caffeine

A dose of caffeine given to 12 volunteers changed their resting pulse (beats per minute) by 4, 1, 7, −2, 3, 0, 5, 2, 6, −1, 3, 5. Does caffeine in general raise the pulse?

\[ \sum d = 33, \qquad \sum d^2 = 179, \qquad \bar d = \frac{33}{12} = 2.75, \] \[ s^2 = \frac{179}{12} - \bar d^2 = 14.9167 - 7.5625 = 7.3542, \qquad s = 2.7119 . \]

The data are already differences: \(d\) = after − before.

(1) \(H_0\): \(\mu_d = 0\). (2) \(H_1\): \(\mu_d > 0\). One-tailed (right).

(3)

\[ t = \frac{\bar d}{s/\sqrt{n-1}} = \frac{2.75}{2.7119/\sqrt{11}} = \frac{2.75}{0.8177} = 3.363 \sim t_{11} . \]

(4) \(t = 3.363 > 1.796\), so \(H_0\) is rejected: caffeine raises the pulse.

WORKED PROBLEM 14 — marks before and after extra classes

Marks of 11 students before (\(x\)) and after (\(y\)) a month of extra classes are below. Did the students benefit?

Before \(x\)2226192720212321242223
After \(y\)2027232722252322212522
\(d = x - y\)2−1−40−2−40−13−31

The same subjects are measured twice, so the samples are paired.

\[ \sum d = −9, \qquad \sum d^2 = 61, \qquad \bar d = \frac{-9}{11} = -0.8182, \] \[ s^2 = \frac{61}{11} - \bar d^2 = 5.5455 - 0.6694 = 4.876, \qquad s = 2.2082 . \]

(1) \(H_0: \mu_1 = \mu_2\): no benefit. (2) \(H_1: \mu_1 < \mu_2\): marks are higher after (\(\mu_d < 0\)). One-tailed (left).

(3)

\[ t = \frac{\bar d}{s/\sqrt{n-1}} = \frac{-0.8182}{2.2082/\sqrt{10}} = \frac{-0.8182}{0.6983} = -1.172 \sim t_{10} . \]

(4) The left-tailed point is \(-1.812\); \(t = -1.172\) is not below it, so \(H_0\) is not rejected: the data do not show that the classes raised marks. Not rejecting \(H_0\) means no significant benefit was shown; it does not show the classes were useless either.

WORKED PROBLEM 15 — two fertilisers, unpaired and paired

Two fertilisers A and B were tried on 8 plots each; the yields (kg) were:

A \(x\)3842404136394142\(\sum x = 319,\ \sum x^2 = 12751\)
B \(y\)4144414339424343\(\sum y = 336,\ \sum y^2 = 14130\)

Is B better than A (i) if the two sets of plots are independent, (ii) if each column is one plot split in two halves, one half for each fertiliser?

In both parts \(H_0: \mu_1 = \mu_2\) and \(H_1: \mu_1 < \mu_2\) (B gives more). One-tailed (left).

(i) Independent samples.

\[ \bar x = 39.875, \quad \bar y = 42, \quad s_1^2 = 3.8594, \quad s_2^2 = 2.25 , \] \[ S^2 = \frac{8(3.8594) + 8(2.25)}{14} = 3.4911, \qquad S = 1.8684 , \] \[ t = \frac{39.875 - 42}{1.8684\sqrt{\tfrac18 + \tfrac18}} = \frac{-2.125}{0.9342} = -2.275 \sim t_{14} . \]

The left-tailed 5% point for 14 d.f. is \(-1.761\); \(t = -2.275\) is below it, so \(H_0\) is rejected: B is better.

(ii) Split plots. Now each plot gives a pair, so the paired test applies, with \(d = x - y\): −3, −2, −1, −2, −3, −3, −2, −1.

\[ \begin{gathered} \sum d = −17, \quad \sum d^2 = 41, \quad \bar d = -2.125, \quad s = 0.7806, \\ t = \frac{-2.125}{0.7806/\sqrt 7} = \frac{-2.125}{0.295} = -7.202 \sim t_7 . \end{gathered} \]

The left-tailed 5% point for 7 d.f. is \(-1.895\); \(t = -7.202\) is far below it, so \(H_0\) is rejected: B is better.

Why (ii) is so much stronger. The mean difference is -2.125 both times, but pairing removes the plot-to-plot variation from the standard error, which falls from 0.934 to 0.295. The same difference, measured against far less noise, gives a much larger \(t\).

D. t-test for a Correlation Coefficient

WORKED PROBLEM 16 — rainfall and yield

The correlation between rainfall and wheat yield over 22 districts is 0.21. Is it significant?

(1) \(H_0: \rho = 0\). (2) \(H_1: \rho \ne 0\). Two-tailed.

(3) By the t-test for a correlation coefficient,

\[ t = \frac{r\sqrt{n-2}}{\sqrt{1 - r^2}} = \frac{0.21\sqrt{20}}{\sqrt{1 - 0.0441}} = \frac{0.9391}{0.9777} = 0.961 \sim t_{20} . \]

The two-tailed 5% value for 20 d.f. is 2.086.

(4) \(|t| = 0.961 < 2.086\), so \(H_0\) is not rejected: no correlation is shown in the population, as far as this sample can tell.

WORKED PROBLEM 17 — 30 pairs with r = 0.5

A sample of 30 pairs from a bivariate normal population gives \(r = 0.5\). Is it significant?

(1) \(H_0: \rho = 0\). (2) \(H_1: \rho \ne 0\). Two-tailed.

(3) By the t-test for a correlation coefficient,

\[ t = \frac{r\sqrt{n-2}}{\sqrt{1 - r^2}} = \frac{0.5\sqrt{28}}{\sqrt{1 - 0.25}} = \frac{2.6458}{0.866} = 3.055 \sim t_{28} . \]

The two-tailed 5% value for 28 d.f. is 2.048.

(4) \(|t| = 3.055 > 2.048\), so \(H_0\) is rejected: the variables are correlated.

WORKED PROBLEM 18 — n = 250, a test and confidence limits

A bivariate sample of 250 from a normal population gives \(r = 0.35\). (i) Is it significant? (ii) Find 95% and 99% confidence limits for \(\rho\).

(1) \(H_0: \rho = 0\). (2) \(H_1: \rho \ne 0\). Two-tailed.

(3) By the t-test for a correlation coefficient,

\[ t = \frac{r\sqrt{n-2}}{\sqrt{1 - r^2}} = \frac{0.35\sqrt{248}}{\sqrt{1 - 0.1225}} = \frac{5.5118}{0.9367} = 5.884 \sim t_{248} . \]

The two-tailed 5% value for 248 d.f. is 1.97.

(4) \(|t| = 5.884 > 1.97\), so \(H_0\) is rejected: the variables are correlated.

For 248 d.f. the \(t\) curve is almost the normal one: \(t_{0.025,248} = 1.97\), against the normal 1.96.

(ii) For a large sample, \(r\) has standard error approximately \((1 - r^2)/\sqrt n = 0.8775/\sqrt{250} = 0.0555\), so

\[ \text{95\%:}\quad 0.35 \pm 1.96(0.0555) \;\Rightarrow\; (0.2412,\; 0.4588), \] \[ \text{99\%:}\quad 0.35 \pm 2.58(0.0555) \;\Rightarrow\; (0.2068,\; 0.4932). \]

A refinement. Away from \(\rho = 0\) the distribution of \(r\) is skewed, and Fisher's \(Z\) (Unit 3) is the more accurate route: \(Z = \tfrac12\ln\dfrac{1.35}{0.65} = 0.3654\), with standard error \(1/\sqrt{247} = 0.0636\), gives \(0.3654 \pm 1.96(0.0636) = (0.2407,\; 0.4902)\) on the \(Z\) scale, and transforming back with \(\tanh\), the 95% interval \((0.2362,\; 0.4543)\). It is not centred on \(r\); it leans towards zero, as the skewness requires.

E. χ² Test for Goodness of Fit

WORKED PROBLEM 19 — random digits

250 digits read from a random number table gave these frequencies. Are the digits equally frequent?

Digit0123456789
\(O_i\)22272528202624292326
\(E_i\)25252525252525252525
\((O_i - E_i)^2/E_i\)0.360.1600.3610.040.040.640.160.04

(1) \(H_0\): the distribution is uniform, so each \(E_i = 250/10 = 25\). (2) \(H_1\): it is not.

(3)

\[ \chi^2 = \sum\frac{(O_i - E_i)^2}{E_i} = \frac{9 + 4 + 0 + 9 + 25 + 1 + 1 + 16 + 4 + 1}{25} = 2.8 \sim \chi^2_{9} . \]

(4) \(\chi^2 = 2.8 < \chi^2_{0.05,9} = 16.92\), so \(H_0\) is not rejected: the data are consistent with a uniform distribution.

WORKED PROBLEM 20 — Mendel's 9 : 3 : 3 : 1

Of 640 pea plants, the four classes A, B, C, D contained 352, 126, 118 and 44. Theory predicts the ratio 9 : 3 : 3 : 1. Do the data support it?

Expected frequencies: \(640 \times \tfrac{9}{16} = 360\), \(640 \times \tfrac{3}{16} = 120\), 120, \(640 \times \tfrac{1}{16} = 40\).

Class\(O_i\)\(E_i\)\(O_i - E_i\)\((O_i - E_i)^2/E_i\)
A352360−80.1778
B12612060.3
C118120−20.0333
D444040.4
Total64064000.9111

(1) \(H_0\): the data follow 9 : 3 : 3 : 1. (2) \(H_1\): they do not.

(3) \(\chi^2 = 0.9111 \sim \chi^2_3\) (4 classes, nothing estimated).

(4) \(0.911 < \chi^2_{0.05,3} = 7.81\), so \(H_0\) is not rejected: the data support the 9 : 3 : 3 : 1 ratio.

WORKED PROBLEM 21 — road accidents by day of the week

105 road accidents in a district were spread over the week as below. Are accidents uniformly distributed over the days?

DaySunMonTueWedThuFriSat
\(O_i\)18131612171019
\(E_i\)15151515151515
\((O_i - E_i)^2/E_i\)0.60.26670.06670.60.26671.66671.0667

(1) \(H_0\): the distribution is uniform, so each \(E_i = 105/7 = 15\). (2) \(H_1\): it is not.

(3)

\[ \chi^2 = \sum\frac{(O_i - E_i)^2}{E_i} = \frac{9 + 4 + 1 + 9 + 4 + 25 + 16}{15} = 4.5333 \sim \chi^2_{6} . \]

(4) \(\chi^2 = 4.53 < \chi^2_{0.05,6} = 12.59\), so \(H_0\) is not rejected: the data are consistent with a uniform distribution.

WORKED PROBLEM 22 — fitting a binomial

Fit a binomial distribution (\(n = 6\)) to the data below and test the goodness of fit.

\(x\)0123456
\(f\)42030261253

Fitting. \(N = \sum f = 100\) and \(\sum fx = 249\), so \(\bar x = 2.49\). For a binomial with \(n = 6\), the mean is \(np\), so \(p = 2.49/6 = 0.415\) and \(q = 0.585\). Then \(P(x) = \binom{6}{x}(0.415)^x(0.585)^{6-x}\) and \(E = 100\,P(x)\):

\(x\)0123456
\(P(x)\)0.04010.17060.30260.28620.15230.04320.0051
\(E\)4.0117.0630.2628.6215.234.320.51

Pooling. Expected frequencies below 5 are merged with their neighbours: classes 0 to 1 are merged; classes 4 to 6 are merged. 4 classes remain:

Class\(O\)\(E\)\(O - E\)\((O - E)^2/E\)
0–12421.072.930.408
23030.26−0.260.0022
32628.62−2.620.2395
4–62020.06−0.060.0002
Total10010000.6499

(1) \(H_0\): the binomial is a good fit. (2) \(H_1\): it is not.

(3) \(\chi^2 = 0.6499\). Degrees of freedom, by §5: 4 classes after pooling, less 1 for the total, less 1 for the estimated \(p\): \(4 - 1 - 1 = 2\).

(4) \(\chi^2 = 0.65 < \chi^2_{0.05,2} = 5.99\), so \(H_0\) is not rejected: the binomial fits well.

WORKED PROBLEM 23 — heads in five tosses

Five coins were tossed 256 times and the number of heads recorded. Are the coins fair?

Heads012345
Frequency \(O\)11368673428
\(E = 256\binom5x/32\)8408080408
\((O - E)^2/E\)1.1250.40.450.61250.10

(1) \(H_0\): the coins are fair, \(p = q = \tfrac12\), so \(P(x) = \binom5x/32\). (2) \(H_1\): they are not.

(3) \(\chi^2 = 1.125 + 0.4 + 0.45 + 0.6125 + 0.1 + 0 = 2.6875\). Here \(p\) is given by the hypothesis, not estimated, and every \(E \ge 5\), so d.f. \(= 6 - 1 = 5\).

(4) \(2.688 < \chi^2_{0.05,5} = 11.07\), so \(H_0\) is not rejected: the coins may be taken as fair.

WORKED PROBLEM 24 — fitting a Poisson

Fit a Poisson distribution to the data below and test the goodness of fit.

\(x\)012345
\(f\)120108511641

Fitting. \(N = 300\), \(\sum fx = 279\), so \(\bar x = 0.93\), and the Poisson mean is estimated by \(\lambda = 0.93\). \(P(x) = e^{-0.93}0.93^x/x!\), with the last class taken as “5 or more” so that the probabilities add to 1; \(E = 300\,P(x)\):

\(x\)012345
\(P(x)\)0.39460.36690.17060.05290.01230.0027
\(E\)118.37110.0851.1915.873.690.81

Pooling. Expected frequencies below 5 are merged with their neighbours: classes 3 to 5 are merged. 4 classes remain:

Class\(O\)\(E\)\(O - E\)\((O - E)^2/E\)
0120118.371.630.0226
1108110.08−2.080.0393
25151.19−0.190.0007
3–52120.370.630.0197
Total30030000.0823

(1) \(H_0\): the Poisson is a good fit. (2) \(H_1\): it is not.

(3) \(\chi^2 = 0.0823\). Degrees of freedom, by §5: 4 classes after pooling, less 1 for the total, less 1 for the estimated \(\lambda\): \(4 - 1 - 1 = 2\).

(4) \(\chi^2 = 0.082 < \chi^2_{0.05,2} = 5.99\), so \(H_0\) is not rejected: the Poisson fits well.

F. χ² Test for Independence of Attributes

WORKED PROBLEM 25 — the 2 × 2 formula

For the \(2 \times 2\) contingency table with cells \(a, b\) / \(c, d\) and \(N = a + b + c + d\), prove that \(\chi^2 = \dfrac{N(ad - bc)^2}{(a+b)(c+d)(a+c)(b+d)}\).

This is proved step by step in §6. In outline: each expected frequency is (row total)(column total)/\(N\); every one of the four deviations \(O - E\) works out to \(\pm(ad - bc)/N\), so \(\chi^2\) is \((ad - bc)^2/N^2\) times the sum of the four reciprocals \(1/E\); and that sum simplifies, because \((a+c) + (b+d) = N\) and \((a+b) + (c+d) = N\), to \(N^3/[(a+b)(c+d)(a+c)(b+d)]\). Multiplying gives the formula.

WORKED PROBLEM 26 — two treatments on 600 plots

Two treatments were applied to 600 plots, and each plot was classified by both. Are the treatments independent?

B₁B₂Total
A₁240 (\(a\))110 (\(b\))350
A₂60 (\(c\))190 (\(d\))250
Total300300600

(1) \(H_0\): the two attributes are independent. (2) \(H_1\): they are not.

(3) By the \(2 \times 2\) formula,

\[ \chi^2 = \frac{600(240 \times 190 - 110 \times 60)^2}{350 \times 250 \times 300 \times 300} = \frac{600(39000)^2}{7875000000} = 115.886 \sim \chi^2_1 . \]

(4) \(115.89 > \chi^2_{0.05,1} = 3.84\), so \(H_0\) is rejected: the two treatments are associated.

WORKED PROBLEM 27 — town and village votes

Polls of 1200 voters each in towns and villages gave the votes for two candidates below. Is the kind of area related to the vote?

PQTotal
Town690 (\(a\))510 (\(b\))1200
Village610 (\(c\))590 (\(d\))1200
Total130011002400

(1) \(H_0\): the two attributes are independent. (2) \(H_1\): they are not.

(3) By the \(2 \times 2\) formula,

\[ \chi^2 = \frac{2400(690 \times 590 - 510 \times 610)^2}{1200 \times 1200 \times 1300 \times 1100} = \frac{2400(96000)^2}{2059200000000} = 10.741 \sim \chi^2_1 . \]

(4) \(10.74 > \chi^2_{0.05,1} = 3.84\), so \(H_0\) is rejected: the kind of area is related to the vote.

WORKED PROBLEM 28 — fitness and exam grade, 3 × 3 at 1%

1000 students are classified by fitness level and by exam grade below. Test at the 1% level whether the two are independent.

Grade AGrade BGrade CTotal
Fit45301590
Average250260190700
Unfit358590210
Total3303752951000

(1) \(H_0\): the two classifications are independent. (2) \(H_1\): they are not.

(3) Expected frequencies \(E_{ij} = (A_i)(B_j)/N\): for example \(E_{11} = 90 \times 330/1000 = 29.7\).

\(O_{ij}\)453015250260190358590
\(E_{ij}\)29.733.7526.55231262.5206.569.378.7561.95
\(O - E\)15.3−3.75−11.5519−2.5−16.5−34.36.2528.05
\((O - E)^2/E\)7.88180.41675.02461.56280.02381.318416.97680.49612.7006
\[ \chi^2 = \sum_i\sum_j\frac{(O_{ij} - E_{ij})^2}{E_{ij}} = 46.4014 \sim \chi^2_{(3-1)(3-1)} = \chi^2_{4} . \]

(4) \(46.401 > \chi^2_{0.01,4} = 13.28\), so \(H_0\) is rejected: fitness and exam grade are related. Most of the statistic comes from the first and last rows, where grade A is more common than expected among fit students and grade C more common among unfit ones.

WORKED PROBLEM 29 — two survey teams

Two survey teams classified the households they visited by monthly spending. Do the teams' classifications differ significantly?

LowMiddleHighVery highTotal
Team I8362469200
Team II4132243100
Total124947012300

(1) \(H_0\): the two classifications are independent. (2) \(H_1\): they are not.

(3) Expected frequencies \(E_{ij} = (\text{row total})(\text{column total})/N\): row Team I 82.67, 62.67, 46.67, 8; row Team II 41.33, 31.33, 23.33, 4. The smallest, 4, is below 5, so cells must be pooled. In a contingency table the pooling has to keep the table rectangular, so the “High” and “Very high” columns are merged in every row:

LowMiddleHigh or Very high
Team I: \(O\) (\(E\))83 (82.67)62 (62.67)55 (54.67)
Team II: \(O\) (\(E\))41 (41.33)32 (31.33)27 (27.33)
\[ \chi^2 = \sum_i\sum_j\frac{(O_{ij} - E_{ij})^2}{E_{ij}} = 0.0314 \sim \chi^2_{(2-1)(3-1)} = \chi^2_{2} . \]

(4) \(0.031 < \chi^2_{0.05,2} = 5.99\), so \(H_0\) is not rejected: the two teams' classifications do not differ significantly.

Pooling only the small cell's own row would leave a table that is no longer a contingency table, so its degrees of freedom would not be \((r-1)(s-1)\) of anything; merging whole columns is the regular procedure.

G. F-test for Equality of Variances

WORKED PROBLEM 30 — standard deviations 3.1 and 2.5

Two samples of sizes 11 and 9 from normal populations have standard deviations 3.1 and 2.5. Do the population variances differ?

\[ S_1^2 = \frac{n_1 s_1^2}{n_1 - 1} = \frac{11(3.1)^2}{10} = 10.571, \qquad S_2^2 = \frac{9(2.5)^2}{8} = 7.0312 . \]

(1) \(H_0: \sigma_1^2 = \sigma_2^2\). (2) \(H_1: \sigma_1^2 \ne \sigma_2^2\).

(3) The larger estimate goes on top (§8), and the degrees of freedom follow it:

\[ F = \frac{S_1^2}{S_2^2} = \frac{10.571}{7.0312} = 1.503 \sim F_{(10,\,8)} . \]

(4) \(1.503 < F_{0.05}(10, 8) = 3.35\), so \(H_0\) is not rejected: the population variances do not differ significantly.

Strictly, with a two-sided \(H_1\) at 5% the upper 2.5% point, \(F_{0.025}(10, 8) = 4.3\), is the comparison; \(F = 1.5\) is below both.

WORKED PROBLEM 31 — sums of squares given, at 1%

A sample of 9 has sum of squares of deviations from its mean 96.8; another of 11 has 88.0. Is the difference between the variances significant at 1%?

Since \(n s^2 = \sum(x - \bar x)^2\), the unbiased estimate is the sum of squares over \(n - 1\):

\[ S_1^2 = \frac{96.8}{8} = 12.1, \qquad S_2^2 = \frac{88.0}{10} = 8.8 . \]

(1) \(H_0: \sigma_1^2 = \sigma_2^2\). (2) \(H_1: \sigma_1^2 \ne \sigma_2^2\).

(3) The larger estimate goes on top (§8), and the degrees of freedom follow it:

\[ F = \frac{S_1^2}{S_2^2} = \frac{12.1}{8.8} = 1.375 \sim F_{(8,\,10)} . \]

(4) \(1.375 < F_{0.01}(8, 10) = 5.06\), so \(H_0\) is not rejected: the difference between the variances is not significant.

WORKED PROBLEM 32 — equality of variances from the raw data

Two samples of sizes 9 and 11 are given. Test the equality of the population variances.

\(x\)14918201512101711\(\sum x = 126,\ \sum x^2 = 1880\)
\(y\)916251814202211262413\(\sum y = 198,\ \sum y^2 = 3908\)
\[ S_1^2 = \frac{1}{n_1 - 1}\left[\sum x^2 - \frac{(\sum x)^2}{n_1}\right] = \frac{1880 - 1764}{8} = 14.5, \] \[ S_2^2 = \frac{1}{n_2 - 1}\left[\sum y^2 - \frac{(\sum y)^2}{n_2}\right] = \frac{3908 - 3564}{10} = 34.4 . \]

(1) \(H_0: \sigma_1^2 = \sigma_2^2\). (2) \(H_1: \sigma_1^2 \ne \sigma_2^2\).

(3) The larger estimate goes on top (§8), and the degrees of freedom follow it:

\[ F = \frac{S_2^2}{S_1^2} = \frac{34.4}{14.5} = 2.372 \sim F_{(10,\,8)} . \]

(4) \(2.372 < F_{0.05}(10, 8) = 3.35\), so \(H_0\) is not rejected: the population variances may be regarded as equal.

WORKED PROBLEM 33 — unbiased estimates given

Two samples of sizes 12 and 16 give unbiased estimates of the population variances, 6 and 11. Can the population variances be regarded as equal?

Unbiased estimates are the \(S^2\) themselves: \(S_1^2 = 6\) (11 d.f.), \(S_2^2 = 11\) (15 d.f.). Nothing is converted; treating them as \(s^2\) and multiplying by \(n/(n-1)\) would inflate both.

(1) \(H_0: \sigma_1^2 = \sigma_2^2\). (2) \(H_1: \sigma_1^2 \ne \sigma_2^2\).

(3) The larger estimate goes on top (§8), and the degrees of freedom follow it:

\[ F = \frac{S_2^2}{S_1^2} = \frac{11}{6} = 1.833 \sim F_{(15,\,11)} . \]

(4) \(1.833 < F_{0.05}(15, 11) = 2.72\), so \(H_0\) is not rejected: the population variances may be regarded as equal.

WORKED PROBLEM 34 — the same normal population? both tests

Sample I: size 11, mean 22, sum of squares of deviations from the mean 120. Sample II: size 13, mean 20.5, sum of squares 150. Can the samples be regarded as drawn from the same normal population, at 5%?

“The same normal population” means the same variance and the same mean, so two tests are needed, the F-test first, because the \(t\)-test for means assumes equal variances (§3).

I. F-test. \(H_0: \sigma_1^2 = \sigma_2^2\) against \(H_1: \sigma_1^2 \ne \sigma_2^2\).

\[ S_1^2 = \frac{120}{10} = 12, \qquad S_2^2 = \frac{150}{12} = 12.5, \qquad F = 1.042 \sim F_{(12,\,10)} . \]

\(1.042 < F_{0.05}(12, 10) = 2.91\): \(H_0\) is not rejected; the variances may be taken as equal.

II. t-test. \(H_0: \mu_1 = \mu_2\) against \(H_1: \mu_1 \ne \mu_2\). Since \(n_1 s_1^2 = \sum(x - \bar x)^2 = 120\) and \(n_2 s_2^2 = 150\),

\[ \begin{gathered} S = \sqrt{\frac{120 + 150}{11 + 13 - 2}} = 3.5032, \\ t = \frac{22 - 20.5}{3.5032\sqrt{\dfrac1{11} + \dfrac1{13}}} = \frac{1.5}{1.4352} = 1.045 \sim t_{22} . \end{gathered} \]

\(|t| = 1.045 < t_{0.025,22} = 2.074\): \(H_0\) is not rejected; the means may be taken as equal.

Conclusion. Both hypotheses stand, so the two samples may be regarded as drawn from the same normal population.

Where this goes next. Small samples cost you the CLT, but every test in this unit still assumed the parent population was normal. Unit 5 asks what is left when even that is unavailable — ordinal data, an obviously skewed sample, an outlier you cannot justify removing. Replacing the observations by their ranks buys a test valid for any continuous distribution; the price is a little power in the case where the data really was normal after all.

→ Unit 5 — Non-parametric Tests