O1, O2 - Binomial hypothesis tests

O1, O2 - Binomial hypothesis tests

Use a sample to investigate a claim about a population proportion. O1 supplies the language of hypotheses, tails and significance; O2 connects exact binomial probabilities to a cautious conclusion about the population.

Population proportions and hypotheses

A manufacturer claims that only 10%10\% of its sensors fail a test. You randomly select 2020 sensors and 55 fail. Is that enough evidence to challenge the claim, or could it be ordinary sampling variation?

The sample failure proportion is 5/20=0.255/20=0.25. That describes the sample exactly. It does not establish that exactly a quarter of all the manufacturer's sensors fail. A hypothesis test weighs the sample evidence against a population claim.

You already know

A random sample can support an inference about its population. For nn independent trials with two outcomes and a constant success probability pp, the number of successes has distribution B(n,p)\mathrm B(n,p). “Success” means the event counted, even when that event is a failure.

Let pp be the probability that a randomly chosen sensor from the current production fails. This is the population proportion we want to investigate. Specify the question about pp before looking at the result.

Null and alternative hypotheses

The null hypothesis, H0H_0, specifies the population value used to calculate reference probabilities. The alternative hypothesis, H1H_1, describes the departure being investigated. For the sensor claim, H0:p=0.10H_0:p=0.10. An increase uses H1:p>0.10H_1:p>0.10, a decrease uses H1:p<0.10H_1:p<0.10, and a change in either direction uses H1:p≠0.10H_1:p\ne0.10.

An increase or decrease calls for a one-tailed test. An unspecified change calls for a two-tailed test. The equality belongs in H0H_0. Neither hypothesis is a statement about the already known sample proportion. These hypothesis conventions are not in the formula booklet: learn them.

Worked example 1: an intended improvement

Question. A service previously delivered 80%80\% of orders on time. A new system is intended to improve this proportion. Define the parameter and state suitable hypotheses.

Plan. Define a population proportion, then translate “improve” into a direction.

p=population proportion delivered on time under the new systemH0:p=0.80reference claimH1:p>0.80improvement means more on time\begin{aligned} p&=\text{population proportion delivered on time under the new system} \\ H_0&:p=0.80 &&\text{reference claim} \\ H_1&:p>0.80 &&\text{improvement means more on time} \end{aligned}

Why this direction? On-time delivery is the event counted, so improvement makes its probability larger.

Answer. Use H0:p=0.80H_0:p=0.80, H1:p>0.80H_1:p>0.80, a one-tailed upper-tail test.

Check. A proportion below 0.800.80 would contradict improvement, so it should not be the rejection direction.

Change only the investigation in example 2: the same new system might improve or worsen performance. The alternative must allow both possibilities.

Worked example 2: a change without a direction

Question. The service now investigates whether its new system has changed the on-time proportion from 0.800.80. Define the parameter and state suitable hypotheses.

Plan. Keep the population parameter and reference value, but include departures on either side.

p=population proportion delivered on time under the new systemH0:p=0.80same reference claimH1:p≠0.80either direction is relevant\begin{aligned} p&=\text{population proportion delivered on time under the new system} \\ H_0&:p=0.80 &&\text{same reference claim} \\ H_1&:p\ne0.80 &&\text{either direction is relevant} \end{aligned}

Why two tails? Both unusually few and unusually many on-time deliveries could provide evidence of change.

Answer. Use H0:p=0.80H_0:p=0.80, H1:p≠0.80H_1:p\ne0.80, a two-tailed test.

Check. Both p=0.70p=0.70 and p=0.90p=0.90 satisfy this alternative; p=0.80p=0.80 does not.

Choose the direction from the purpose of the investigation. Selecting a favourable tail after seeing the sample changes the test being carried out.

Watch out

Wrong: H0:p=5/20H_0:p=5/20. This replaces the population claim with the sample evidence. Right: test H0:p=0.10H_0:p=0.10, and use the observed count 55 to judge that claim.

The next question changes the event from timely deliveries to complaints. Define the event clearly before writing an inequality.

The null model and the relevant tail

To judge the sensor claim, temporarily assume it is true. Under H0H_0, the number XX of failures in the sample has distribution B(20,0.10)\mathrm B(20,0.10). This tells us which counts would be unusual if the population failure proportion really were 0.100.10.

A binomial model needs independent trials with a common probability. Sampling without replacement from a much larger population can make independence a reasonable approximation. Twenty related sensors from one faulty batch need not represent twenty independent chances from all production.

Test statistic and one-tailed p-value

A test statistic is a quantity calculated from the sample; here its observed value is the number of failures. Under the null, the random variable XX describes its possible values. A one-tailed p-value is the probability, assuming H0H_0, of the observed count or a count further in the direction of H1H_1.

For an increase, include the observed count and every larger count. For a decrease, include it and every smaller count. A calculator's cumulative binomial function usually returns a lower inclusive probability, so the discrete boundary matters.

Inclusive binomial tails

For an observed count xx,

H1:p>p0:P(X≥x)=1−P(X≤x−1)H1:p<p0:P(X≤x)\begin{aligned} H_1:p>p_0&:\quad \mathrm P(X\ge x)=1-\mathrm P(X\le x-1) \\ H_1:p<p_0&:\quad \mathrm P(X\le x) \end{aligned}

Use X∼B(n,p0)X\sim\mathrm B(n,p_0) under H0H_0. The binomial probability formula is supplied separately; this box gives the tail choices and complement boundaries. Not in the formula booklet: learn it.

A significance level provides the threshold for deciding that evidence is sufficiently unusual. At a one-tailed 5%5\% level, reject H0H_0 if the relevant p-value is at most 0.050.05. Keep unrounded probabilities until the comparison.

Worked example 3: five failures

Question. For 2020 independent sensors, 55 fail. Test H0:p=0.10H_0:p=0.10 against H1:p>0.10H_1:p>0.10 at 5%5\%.

Plan. Calculate the inclusive upper tail under the claimed failure proportion.

X∼B(20,0.10)under H0P(X≥5)=1−P(X≤4)include the observed five=0.0431745…<0.05calculator and comparison\begin{aligned} X&\sim\mathrm B(20,0.10) &&\text{under }H_0 \\ \mathrm P(X\ge5)&=1-\mathrm P(X\le4) &&\text{include the observed five} \\ &=0.0431745\ldots<0.05 &&\text{calculator and comparison} \end{aligned}

Why the upper tail? More failures support the proposed increase in the population failure proportion.

Answer. Reject H0H_0. There is sufficient evidence at 5%5\% to suggest that the population failure proportion exceeds 0.100.10.

Check. The complement removes counts 00 to 44, leaving exactly 55 to 2020.

Example 4 changes only the observed count. A sample proportion can exceed the claim without giving sufficiently strong evidence against it.

Worked example 4: four failures

Question. Repeat the same 5%5\% upper-tail test when 44 of the 2020 sensors fail.

Plan. Keep the null model, but move the inclusive boundary to four.

X∼B(20,0.10)same null modelP(X≥4)=1−P(X≤3)include four this time=0.132953…>0.05not sufficiently unusual\begin{aligned} X&\sim\mathrm B(20,0.10) &&\text{same null model} \\ \mathrm P(X\ge4)&=1-\mathrm P(X\le3) &&\text{include four this time} \\ &=0.132953\ldots>0.05 &&\text{not sufficiently unusual} \end{aligned}

Why does the probability increase? The tail now includes the additional possible count 44.

Answer. Do not reject H0H_0. There is insufficient evidence at 5%5\% to suggest that the population failure proportion exceeds 0.100.10.

Check. Although 4/20=0.20>0.104/20=0.20>0.10, the relevant null probability is about 13.3%13.3\%, above the chosen threshold.

The p-value concerns a set of possible outcomes, rather than just the exact count observed.

Watch out

Wrong: P(X≥5)=1−P(X≤5)\mathrm P(X\ge5)=1-\mathrm P(X\le5). This omits the observed count itself. Right: subtract P(X≤4)\mathrm P(X\le4). Using only P(X=5)\mathrm P(X=5) also omits more extreme counts.

Use your calculator for exact binomial tails. A Normal approximation is unnecessary here, and the current Mathematics formula booklet contains no statistical tables.

Critical regions for one and two tails

Instead of waiting for a sample and then calculating its p-value, decide in advance which counts would lead to rejection. This makes the decision rule visible.

Critical and acceptance regions

The critical region is the set of possible test-statistic values leading to rejection of H0H_0. Its boundary count or counts are called critical values. The remaining possible counts form the acceptance region, where the test does not reject H0H_0. The name does not mean that the null has been proved.

For a lower-tail test with nominal level α\alpha, choose the largest integer cc satisfying P(X≤c)≤α\mathrm P(X\le c)\le\alpha. Check that c+1c+1 would exceed the limit. For an upper tail, choose the smallest cc satisfying P(X≥c)≤α\mathrm P(X\ge c)\le\alpha, and check c−1c-1. These rules are not in the formula booklet: learn them.

Worked example 5: a lower critical region

Question. Under H0H_0, X∼B(25,0.20)X\sim\mathrm B(25,0.20). Find the lower-tail 5%5\% critical region and its actual rejection probability.

Plan. Find consecutive counts whose cumulative probabilities fall either side of 0.050.05.

P(X≤1)=0.0273897…≤0.05allowedP(X≤2)=0.0982252…>0.05next count is too much\begin{aligned} \mathrm P(X\le1)&=0.0273897\ldots\le0.05 &&\text{allowed} \\ \mathrm P(X\le2)&=0.0982252\ldots>0.05 &&\text{next count is too much} \end{aligned}

Why check the next count? It proves that the chosen lower region is as large as the significance limit permits.

Answer. The critical region is X≤1X\le1, with critical value 11. Its actual rejection probability under H0H_0 is 0.0273897…0.0273897\ldots, about 2.74%2.74\%. The acceptance region is 2≤X≤252\le X\le25.

Check. Adding count 22 would increase the rejection probability beyond 5%5\%.

Example 6 changes only the alternative's direction. The same distribution now needs an upper tail; reflecting the old boundary would be wrong because this binomial distribution is not symmetric.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account