3.5 Practice problems

Problem 3.1. [Exercises on Hypothesis Testing] A machine should be set to produce bags of sugar whose weights are normally distributed with mean \(1000\) g and standard deviation \(5\) g. To check the setting, a sample of nine bags is taken and the mean is found to be \(1003\) g.

(a).
Is the machine correctly set? (Assume the standard deviation cannot change.)
(b).
Is the machine set too high?

Show solution

Solution. Note first that \(\sigma = 5\) is known and cannot change, so the test statistic is \(Z\) – not \(t\), despite \(n = 9\) being small. The population is stated to be normal, which is what a small sample requires. \[Z=\frac {\overline {X}-\mu _0}{\sigma /\sqrt {n}} =\frac {1003-1000}{5/\sqrt {9}}=\frac {3}{5/3}=1.80.\]

(a). “Correctly set” means neither too high nor too low, so this is two-tailed: \[H_0:\mu =1000 \qquad \text {against}\qquad H_1:\mu \neq 1000.\] At \(\alpha =0.05\) the critical values are \(\pm 1.96\). Since \(|1.80|<1.96\) we fail to reject \(H_0\). Equivalently, the \(P\)-value is \(2\times P(Z>1.80)=0.072\), which exceeds \(0.05\). There is no evidence that the machine is incorrectly set.

(b). “Set too high” names a direction, so this is one-tailed: \[H_0:\mu =1000 \qquad \text {against}\qquad H_1:\mu >1000.\] The critical value is now \(Z_{0.05}=1.645\), and \(1.80>1.645\), so we reject \(H_0\). The \(P\)-value is \(P(Z>1.80)=0.036\), below \(0.05\).

The two parts use the same data and reach opposite conclusions, and that is the point of the question. A one-tailed test puts the whole of \(\alpha \) into one tail, so it is more willing to reject in that direction – \(1.645\) against \(1.96\). The price is that it cannot detect a departure the other way at all: had the mean come out at \(997\), part (b) would have found nothing whatever.

This is why the alternative hypothesis must be chosen before seeing the data. Picking the one-tailed version after noticing the mean came out high is not a stronger test; it is a way of manufacturing significance.

Problem 3.2. [Exercises on Hypothesis Testing] The times taken by a salesman to travel between two shops on 50 occasions averaged 64 minutes with a standard deviation of \(6.3\) minutes. He claims that this is evidence that the journey takes longer since he changed to a smaller car, as before he averaged 60 minutes. Do you agree with the salesman?

Show solution

Solution. Here \(\sigma \) is unknown, but \(n=50\) is large, so \(Z\) serves. Testing \(H_0:\mu =60\) against \(H_1:\mu >60\): \[Z=\frac {64-60}{6.3/\sqrt {50}}=\frac {4}{0.891}=4.49.\] This is far beyond \(1.645\); the \(P\)-value is about \(0.0000036\). The journey time has certainly increased.

But that is not what the salesman claimed. He claimed the journey takes longer because he changed to a smaller car. The test establishes that the times are longer; it says nothing whatever about the cause. These are observational data, not an experiment: the car was not assigned at random, and nothing was held constant. Traffic may have grown heavier, the route may have changed, roadworks may have appeared, he may be older or busier.

So: agree that the journey now takes significantly longer. Do not agree that the car is the reason. A statistical test can tell you that something changed; only a controlled comparison can tell you what changed it.

Problem 3.3. [Exercises on Hypothesis Testing] A manufacturer claims that his light bulbs have an average lifetime of \(1500\) hours. A purchaser checks this and finds that six bulbs last \[1472,\quad 1486,\quad 1401,\quad 1350,\quad 1610,\quad 1590 \text { hours}.\] Does this evidence support the manufacturer’s claim?

Show solution

Solution. With \(n=6\) and \(\sigma \) unknown, this calls for \(t\) with \(n-1=5\) degrees of freedom. \[\overline {X}=\frac {8909}{6}=1484.83, \qquad \hat {S}=102.08.\] Testing \(H_0:\mu =1500\) against \(H_1:\mu \neq 1500\): \[t=\frac {1484.83-1500}{102.08/\sqrt {6}}=\frac {-15.17}{41.67}=-0.364.\] The critical value is \(t_{5,\,0.025}=2.571\), and \(|-0.364|\) is nowhere near it. The \(P\)-value is \(0.73\). We fail to reject \(H_0\): the evidence is consistent with the claim.

Consider why it is consistent. The sample mean is 15 hours below the claim, but the bulbs themselves range from 1350 to 1610 – a standard deviation of over 100 hours. Against that much variation, and with only six observations, a shortfall of 15 hours is nothing.

Note what this does not say. It does not show the claim is true. With six bulbs the test would also have failed to detect a genuine mean of 1450, or 1550. The purchaser has not confirmed the manufacturer’s figure; they have merely failed to contradict it, which is a much weaker thing and would take a far larger sample to improve.

Problem 3.4. [Exercises on Hypothesis Testing] A firm employs 300 women and 100 men. The mean number of days absent last year for the women was \(5.3\) with a standard deviation of \(2.2\); for the men the figures were \(6.2\) and \(2.9\). Is the difference between the means significant?

Show solution

Solution. Two independent samples, both large, so \(Z\) applies. Testing \(H_0:\mu _M=\mu _W\) against \(H_1:\mu _M\neq \mu _W\), the standard error of the difference is \[SE=\sqrt {\frac {s_M^2}{n_M}+\frac {s_W^2}{n_W}} =\sqrt {\frac {2.9^2}{100}+\frac {2.2^2}{300}}=\sqrt {0.0841+0.0161}=0.317,\] and \[Z=\frac {6.2-5.3}{0.317}=2.84.\] Since \(|2.84|>1.96\) we reject \(H_0\) at the \(5\%\) level; the \(P\)-value is \(0.0045\). The difference is statistically significant.

Whether it matters is a separate question. The difference is \(0.9\) of a day per year. Whether that is worth acting on is a judgement about the firm, not a statistical one – and with 400 employees the study is large enough to detect differences far too small to be of any practical use. Significance and importance are not the same thing.

Problem 3.5. [Exercises on Hypothesis Testing] A market gardener tests a new pesticide, which the manufacturers claim increases yields, by applying it to one of his two orchards. The treated orchard contains twenty trees, with mean yield \(98\) kg and standard deviation \(10\) kg. The untreated orchard contains fifteen trees, with corresponding values \(94\) kg and \(8\) kg. Test whether these results are consistent with the yields being drawn from the same population.

Show solution

Solution. Both samples are small and \(\sigma \) is unknown, so this is a pooled two-sample \(t\)-test. The variances are close enough to pool – \(\tfrac {100}{64}=1.56\), comfortably inside the \(\tfrac 12\) to \(2\) guideline: \[S_p^2=\frac {(n_1-1)\hat {S}_1^2+(n_2-1)\hat {S}_2^2}{n_1+n_2-2} =\frac {19(100)+14(64)}{33}=\frac {2796}{33}=84.73, \qquad S_p=9.20.\] \[SE=S_p\sqrt {\frac {1}{20}+\frac {1}{15}}=9.20\times 0.342=3.14, \qquad t=\frac {98-94}{3.14}=1.27\] with \(n_1+n_2-2=33\) degrees of freedom. The critical value is \(t_{33,\,0.025}=2.035\), and the \(P\)-value is \(0.21\). We fail to reject \(H_0\): the results are consistent with both orchards being drawn from the same population.

Two remarks. First, the treated orchard did yield \(4\) kg more on average – but with trees varying by \(8\) to \(10\) kg about their own means, a gap that size is unremarkable. The pesticide has not been shown to work.

Second, and more seriously, the experiment cannot answer the question even in principle. One whole orchard was treated and the other was not, so “pesticide” is completely confounded with “orchard” – with its soil, drainage, aspect, age of trees and everything else. Had the difference been significant, we still could not have attributed it to the pesticide. A sound design would assign treatment to individual trees at random within both orchards, which is exactly what the next chapter’s randomised block design sets out to do.

Problem 3.6. [Exercises on Hypothesis Testing] The table gives the times taken, in minutes, by eight typists to type the same number of words on two different typewriters. Do the data indicate any difference in speed between the two machines?

Typist A B C D E F G H
\(X\) — Typewriter 1 6.3 4.5 7.1 8.4 3.7 3.9 4.7 5.2
\(Y\) — Typewriter 2 5.1 4.4 6.2 7.3 4.5 4.0 3.6 5.1

Show solution

Solution. The first decision matters more than the arithmetic: the same eight typists used both machines, so the two rows are not independent samples. They are eight pairs, and the test must be applied to the differences.

Typist A B C D E F G H
\(d=X-Y\) 1.2 0.1 0.9 1.1 \(-0.8\) \(-0.1\) 1.1 0.1
Table 29: Differences in typing time, machine 1 minus machine 2.

1.
\(H_0:\ \mu _d=0\) (no difference between the machines); \(H_1:\ \mu _d\neq 0\).
2.
\(\alpha =5\%\), two-tailed.
3.
From the differences, \(\overline {d}=0.45\) and \(\widehat {S}_d=0.729\), so \[t=\frac {\overline {d}}{\widehat {S}_d/\sqrt {n}}=\frac {0.45}{0.729/\sqrt {8}}=\frac {0.45}{0.2577}=1.75\] on \(n-1=7\) degrees of freedom.
4.
Critical region: \(t_{7,\,0.025}=2.365\), so reject if \(|t|>2.365\).
5.
\(1.75<2.365\), so we fail to reject \(H_0\). There is no evidence of a difference in speed between the two typewriters.

Why the pairing matters. The typists differ enormously among themselves — D takes over twice as long as E — and that variation has nothing to do with the machines. Pairing removes it: only the eight differences are used, and the typist-to-typist spread cancels. Had the data been treated as two independent samples of eight, the test statistic would have been \(t=0.62\) rather than \(1.75\), because the between-typist variation would have been left in the error term, swamping the effect being looked for.

Problem 3.7. [Exercises on Hypothesis Testing] Nationally the success rate for people taking their driving test for the first time is \(40\%\). A driving instructor claims his record is superior because, of his \(50\) pupils who took the test for the first time last year, \(25\) passed. Is his claim justified?

Show solution

Solution.

1.
\(H_0:\ P=0.40\) (the instructor’s pupils are no different from the national rate); \(H_1:\ P>0.40\). The claim is that he is better, so the test is one-tailed.
2.
\(\alpha =5\%\).
3.
\(\hat {P}=\frac {25}{50}=0.5\). Under \(H_0\) the standard error uses the hypothesised \(P\), not the observed one: \[\text {S.E}=\sqrt {\frac {P_0(1-P_0)}{n}}=\sqrt {\frac {0.4(0.6)}{50}}=0.0693\] \[Z=\frac {0.5-0.4}{0.0693}=1.44.\]
4.
Critical region: \(z_{0.05}=1.645\), so reject if \(Z>1.645\).
5.
\(1.44<1.645\), so we fail to reject \(H_0\). His claim is not justified at the \(5\%\) level.

A pass rate of \(50\%\) against a national \(40\%\) looks convincing until the sample size is taken into account. With only \(50\) pupils, a run of that size happens about \(7\) times in \(100\) by chance alone even for an average instructor. Note also that the standard error is computed from \(P_0=0.4\) and not from \(\hat {P}=0.5\): the test asks how surprising the data are if \(H_0\) is true, so every quantity in it is computed under \(H_0\).

Problem 3.8. [Exercises on Hypothesis Testing] In a random sample of \(500\) people in Lusaka, \(270\) are men of whom \(160\) are smokers, and \(230\) are women of whom \(110\) are smokers. Is there evidence that the men of Lusaka are more likely to smoke than the women?

Show solution

Solution.

1.
\(H_0:\ P_1=P_2\) (men and women are equally likely to smoke); \(H_1:\ P_1>P_2\), one-tailed.
2.
\(\alpha =5\%\).
3.
\(\hat {P}_1=\frac {160}{270}=0.593\) and \(\hat {P}_2=\frac {110}{230}=0.478\). Under \(H_0\) the two proportions are equal, so the best estimate of that common value pools both samples: \[\hat {P}=\frac {160+110}{270+230}=\frac {270}{500}=0.540\] \[\text {S.E}=\sqrt {\hat {P}(1-\hat {P})\left (\frac {1}{n_1}+\frac {1}{n_2}\right )} =\sqrt {0.540(0.460)\left (\frac {1}{270}+\frac {1}{230}\right )}=0.0447\] \[Z=\frac {0.593-0.478}{0.0447}=2.56.\]
4.
Critical region: \(z_{0.05}=1.645\).
5.
\(2.56>1.645\), so we reject \(H_0\). There is evidence, at the \(5\%\) level, that men in Lusaka are more likely to smoke than women (\(P=0.005\)).

The pooling is the point of this question. Since \(H_0\) asserts the two proportions are equal, the standard error must be built from a single pooled estimate of that shared proportion — not from \(\hat {P}_1\) and \(\hat {P}_2\) separately, which is what a confidence interval for the difference would use. The two calculations look similar and answer different questions.

Problem 3.9. [Test]

(a).
Explain why the \(\chi ^2\) statistic from a \(2\times 2\) contingency table has only one degree of freedom.
(b).
State what is meant by a Type I and a Type II error.
(c).
The mass of packs of unwrapped chocolates is normal with mean \(508\) g and standard deviation \(4\) g. A pack weighs \(520\) g and you are not told whether the chocolates are wrapped. Carry out a significance test to show there is evidence that they are wrapped.
(d).
For a test of \(H_0:\mu =\mu _0\) on a sample of \(n\) observations from a normal distribution, state how your decision to use the \(t\)-distribution would be influenced by (i) the value of \(n\), (ii) whether \(\sigma \) is known.

Show solution

Solution. (a) The row and column totals are treated as fixed. Once one cell of a \(2\times 2\) table is chosen, the other three follow by subtraction — the rest of the first row, the rest of the first column, and then the last cell twice over. Only one number is free to vary, so \(v=1\). The general formula says the same thing: \[v=(r-1)(c-1)=(2-1)(2-1)=1.\]

(b) A Type I error is rejecting \(H_0\) when it is true; its probability is \(\alpha \), the significance level, which the experimenter chooses. A Type II error is failing to reject \(H_0\) when it is false; its probability is \(\beta \), which depends on how far the truth lies from \(H_0\) and is not chosen directly. The power of the test is \(1-\beta \).

(c)

1.
\(H_0:\) the chocolates are unwrapped, so \(\mu =508\); \(H_1:\) they are wrapped, so \(\mu >508\). Wrapping can only add mass, so the test is one-tailed.
2.
\(\alpha =5\%\).
3.
\[Z=\frac {520-508}{4}=3.0.\]
4.
Critical region: \(Z>1.645\).
5.
\(3.0>1.645\), so we reject \(H_0\). There is evidence that the chocolates are wrapped.

Note the standard deviation used is \(\sigma =4\), not \(\sigma /\sqrt {n}\): this is a single pack, not the mean of a sample. A pack this heavy would occur in only about one unwrapped pack in \(740\), so the conclusion is not marginal.

(d) Both conditions matter, and they interact.

(i).
\(n\) enters through the degrees of freedom, \(n-1\). For small \(n\) the \(t\) distribution is appreciably wider than the normal; by about \(n=30\) the two are close enough that \(Z\) is used instead.
(ii).
This is the deciding condition. If \(\sigma \) is known, use \(Z\) whatever \(n\) is, because the population is normal and no estimation is involved. If \(\sigma \) is unknown and must be estimated by \(\widehat {S}\), that estimate carries its own uncertainty and \(t\) is the correct distribution.

So: \(\sigma \) known \(\Rightarrow \) \(Z\); \(\sigma \) unknown and \(n\) small \(\Rightarrow \) \(t\); \(\sigma \) unknown and \(n\) large \(\Rightarrow \) \(t\) strictly, but \(Z\) is an acceptable approximation.

Problem 3.10. [Test]

(a).
Explain the difference between a completely randomised design and a randomised block design.
(b).
Explain briefly how a scatter diagram can show whether there is correlation between two quantities. For the data below, calculate a coefficient of rank correlation and comment.

\(x\) 29 81 60 88 91 91 86 99 72 42
\(y\) 74 86 63 74 70 63 41 81 29 56

Show solution

Solution. (a) In a completely randomised design the treatments are allocated to experimental units entirely at random, and every difference not due to treatment falls into one undifferentiated error term. It is the simplest design and it is the right one when the units are genuinely alike.

In a randomised block design the units are first sorted into blocks of similar units — the same subject, the same field, the same day — and the treatments are then randomised within each block. Every treatment appears once in every block. The block-to-block variation is then measured and removed from the error term, so the comparison between treatments is made on a smaller residual and the test is more sensitive.

The cost is degrees of freedom: with \(b\) blocks, \(b-1\) of them leave the error term. Blocking pays when the blocks genuinely differ and wastes those degrees of freedom when they do not.

(b) A scatter diagram plots one variable against the other, one point per pair. If the points cluster about a rising line the correlation is positive; about a falling line, negative; if they fill the plot with no pattern, there is little or none. The tighter the points lie to a line, the stronger the correlation. The diagram also shows what a coefficient cannot: a curved relationship, or a single outlier that is driving the whole result.

Ranking each variable, and sharing ranks between the two \(91\)s and the two \(63\)s:

Rank \(x\) 1 5 3 7 8.5 8.5 6 10 4 2
Rank \(y\) 7.5 10 4.5 7.5 6 4.5 2 9 1 3
\(d\) \(-6.5\) \(-5\) \(-1.5\) \(-0.5\) 2.5 4 4 1 3 \(-1\)
\(d^2\) 42.25 25 2.25 0.25 6.25 16 16 1 9 1
Table 30: Ranks and differences. Tied values share the average of the ranks they occupy.

With \(\sum d^2=119\) and \(n=10\), \[r_s=1-\frac {6(119)}{10(99)}=1-0.721=0.279.\]

Comment. At \(0.279\), against a critical value of \(0.648\) for \(n=10\) at the \(5\%\) level, this is not significant. There is no evidence of any monotonic relationship between \(x\) and \(y\). The product-moment coefficient agrees, at \(r=0.113\). A scatter diagram of these points would show a shapeless cloud, which is exactly what such coefficients describe.

Problem 3.11. [Assignment] In a multiple-choice test a student chooses between three answers for each of ten questions. He gets six correct. Test at the \(5\%\) level the hypothesis that he was guessing.

Show solution

Solution. With only ten trials the normal approximation is not safe — \(np_0=10\left (\tfrac {1}{3}\right )=3.3\) is well under the usual threshold of \(5\) — so work with the binomial directly.

1.
\(H_0:\ P=\tfrac {1}{3}\) (he is guessing); \(H_1:\ P>\tfrac {1}{3}\) (he knows something).
2.
\(\alpha =5\%\), one-tailed.
3.
Under \(H_0\), \(X\sim B\!\left (10,\tfrac {1}{3}\right )\), and the evidence against \(H_0\) is \[P(X\geq 6)=\sum _{x=6}^{10}\binom {10}{x}\left (\tfrac {1}{3}\right )^x\left (\tfrac {2}{3}\right )^{10-x}=0.0766.\]
4.
Decision: \(0.0766>0.05\), so we fail to reject \(H_0\). There is not enough evidence, at the \(5\%\) level, to say he was doing better than guessing.

Six out of ten feels convincing, and it is not quite. Working out where the boundary lies is instructive: \(P(X\geq 7)=0.0197\), so seven correct would have been significant and six is not. With ten questions the test is a blunt instrument.

Problem 3.12. [Assignment] A die is suspected of being biased towards a six. It is thrown eight times and gives three sixes. Is there evidence at the \(2\%\) significance level that the die is biased towards a six?

Show solution

Solution.

1.
\(H_0:\ P=\tfrac {1}{6}\) (the die is fair); \(H_1:\ P>\tfrac {1}{6}\).
2.
\(\alpha =2\%\), one-tailed.
3.
Under \(H_0\), \(X\sim B\!\left (8,\tfrac {1}{6}\right )\): \[P(X\geq 3)=1-P(X\leq 2)=0.1348.\]
4.
\(0.1348>0.02\), so we fail to reject \(H_0\). There is no evidence at the \(2\%\) level that the die is biased.

Three sixes in eight throws is \(37.5\%\) against an expected \(16.7\%\) — more than double — and still nowhere near significant. Eight throws is simply too few. To detect bias of this size reliably the die would have to be thrown scores of times.

Problem 3.13. [Assignment] At one telephone exchange, \(200\) subscribers made a total of \(13\,248\) calls in a period. At another, \(300\) subscribers made \(20\,922\) calls. The standard deviation of the number of calls per subscriber at either exchange is \(8\). Is there evidence of a difference between the two exchanges in average frequency of calls?

Show solution

Solution. The means are \[\overline {X}_1=\frac {13\,248}{200}=66.24,\qquad \overline {X}_2=\frac {20\,922}{300}=69.74.\]

1.
\(H_0:\ \mu _1=\mu _2\); \(H_1:\ \mu _1\neq \mu _2\), two-tailed.
2.
\(\alpha =5\%\).
3.
\(\sigma =8\) is known for both, so \[\text {S.E}=\sigma \sqrt {\frac {1}{n_1}+\frac {1}{n_2}}=8\sqrt {\frac {1}{200}+\frac {1}{300}}=0.7303\] \[Z=\frac {66.24-69.74}{0.7303}=-4.79.\]
4.
Critical region: \(|Z|>1.96\).
5.
\(|-4.79|>1.96\), so we reject \(H_0\). There is very strong evidence that subscribers at the two exchanges differ in how often they call.

A difference of \(3.5\) calls, against a standard deviation of \(8\), is small for an individual subscriber — but the standard error of the difference in means is only \(0.73\) because the samples are large. This is the reverse of the previous two questions: there, large effects went undetected in tiny samples; here, a modest effect is detected easily in large ones.

Problem 3.14. [Assignment] In a butter packing plant the quantity packed in a day is normal with standard deviation \(39\) kg. Two packers, A and B, average \(1518\) kg and \(1499\) kg per day respectively over a \(26\)-day month. Is the performance of the two operators significantly different?

Show solution

Solution.

1.
\(H_0:\ \mu _A=\mu _B\); \(H_1:\ \mu _A\neq \mu _B\), two-tailed.
2.
\(\alpha =5\%\).
3.
\[\text {S.E}=39\sqrt {\frac {1}{26}+\frac {1}{26}}=10.82,\qquad Z=\frac {1518-1499}{10.82}=1.76.\]
4.
Critical region: \(|Z|>1.96\).
5.
\(1.76<1.96\), so we fail to reject \(H_0\). The difference of \(19\) kg per day is not significant at the \(5\%\) level.

This one is close — \(1.76\) against a critical \(1.96\), a \(P\)-value of about \(0.08\). Worth reporting as ”not significant at \(5\%\), but suggestive”, rather than as a flat verdict of no difference. A few more days of data could settle it either way.

Problem 3.15. [Assignment] You are an expert witness in a case where a gaming club is accused of running an unfair roulette wheel. Out of \(3700\) spins, zero — on which the club wins — came up \(140\) times. There are \(37\) equally likely scores, \(0\) to \(36\). Test whether there is evidence that the wheel is biased, and explain briefly what the test means, bearing in mind that you must convince a non-mathematical jury.

Show solution

Solution.

1.
\(H_0:\ P=\tfrac {1}{37}\) (the wheel is fair); \(H_1:\ P\neq \tfrac {1}{37}\).
2.
\(\alpha =5\%\).
3.
On a fair wheel the expected number of zeros in \(3700\) spins is \[np_0=3700\times \tfrac {1}{37}=100,\] with standard deviation \[\sqrt {np_0(1-p_0)}=\sqrt {3700\left (\tfrac {1}{37}\right )\left (\tfrac {36}{37}\right )}=9.86.\] So \[Z=\frac {140-100}{9.86}=4.06.\]
4.
\(|4.06|>1.96\), so we reject \(H_0\). There is strong evidence that the wheel is biased in the club’s favour.

For the jury. On an honest wheel, zero should come up about \(100\) times in \(3700\) spins. It came up \(140\). The question is whether \(40\) extra is the kind of thing luck produces. It is not: the natural run-to-run variation here is about \(10\) spins either way, so \(140\) is four times further out than ordinary luck accounts for. If this wheel were honest and the evening were repeated every night, a result this extreme would turn up less than once in twenty thousand nights.

Two cautions to state plainly, since the whole case may rest on them. The test does not prove the wheel was rigged deliberately — a warped wheel or a worn pocket would produce the same figures. And it does not prove bias with certainty; it says the result is far too extreme to be comfortably explained by chance.

Problem 3.16. [Assignment] The table shows cases of and deaths from malaria under two treatments.

Treatment Cases Deaths
Antitoxin 228 37
Ordinary 337 28

Test whether the proportion who die under antitoxin treatment differs significantly from the proportion who die under ordinary treatment.

Show solution

Solution. \[\hat {P}_1=\frac {37}{228}=0.1623,\qquad \hat {P}_2=\frac {28}{337}=0.0831.\]

1.
\(H_0:\ P_1=P_2\); \(H_1:\ P_1\neq P_2\), two-tailed.
2.
\(\alpha =5\%\).
3.
Pooling under \(H_0\): \[\hat {P}=\frac {37+28}{228+337}=\frac {65}{565}=0.1150\] \[\text {S.E}=\sqrt {0.1150(0.8850)\left (\frac {1}{228}+\frac {1}{337}\right )}=0.02736\] \[Z=\frac {0.1623-0.0831}{0.02736}=2.89.\]
4.
\(|2.89|>1.96\), so we reject \(H_0\). The death rates differ significantly; the antitoxin group fared worse, at about \(16\%\) against \(8\%\).

The same data as a \(2\times 2\) contingency table give \(\chi ^2=8.38\) on \(1\) degree of freedom, against a critical \(3.841\) — the same conclusion, and necessarily so, since \(Z^2=2.89^2=8.38\). For a \(2\times 2\) table the two tests are algebraically identical.

Worth saying what the test cannot show: this is observational data, not an experiment. If the sicker patients were the ones given antitoxin, that alone would produce this result.

Problem 3.17. [Assignment] A box contains either (\(H_0\)) ten white and ninety black counters, or (\(H_1\)) fifty white and fifty black. Four counters are drawn at random without replacement. If all four are black, \(H_0\) is accepted; otherwise it is rejected. Find the sizes of the Type I and Type II errors.

Show solution

Solution. Both errors come from the same probability, computed under different hypotheses: the chance that all four draws are black.

Under \(H_0\) there are \(90\) black of \(100\), drawn without replacement: \[P(\text {4 black}\mid H_0)=\frac {90}{100}\times \frac {89}{99}\times \frac {88}{98}\times \frac {87}{97}=0.6516.\] A Type I error is rejecting \(H_0\) when it is true, which happens whenever the four are not all black: \[\alpha =1-0.6516=0.3484.\]

Under \(H_1\) there are \(50\) black of \(100\): \[P(\text {4 black}\mid H_1)=\frac {50}{100}\times \frac {49}{99}\times \frac {48}{98}\times \frac {47}{97}=0.0587.\] A Type II error is accepting \(H_0\) when \(H_1\) is true, which is exactly this event: \[\beta =0.0587.\]

The test is badly unbalanced. It almost never lets a fifty-fifty box pass as ninety-ten (\(\beta \) under \(6\%\)), but it wrongly rejects a genuine ninety-ten box more than a third of the time. The power, \(1-\beta =0.941\), is excellent; the size, \(\alpha =0.348\), is unacceptable for most purposes. Requiring all four draws to be black is simply too strict a condition to impose on the null hypothesis, and drawing more counters — or accepting \(H_0\) on three blacks out of four — would balance it better.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.