Leaving Certificate Mathematics11.9 Hypothesis testing and confidence intervals

All books

11.9 Hypothesis testing and confidence intervals — Learn

Prerequisites: Section 11.6 — the normal distribution; Section 11.8 — the standard error and the central limit theorem.

Objectives: write a null and an alternative hypothesis; carry out a two-tailed large-sample test of a population mean; build a 95%95\% confidence interval for a mean and for a proportion; interpret a pp-value.

By the end of this section you can test a claim about a population, and you can state how sure the answer is.

Hypotheses

A hypothesis test starts with a claim about a population parameter. The claim that nothing has changed is the null hypothesis, written H0H_0. The claim we are looking for evidence of is the alternative hypothesis, written H1H_1.

Example 1. A company claims that the mean charging time of its new phone is 4444 minutes. A sample suggests it may be different. Write the hypotheses.

H0:μ=44H1:μ≠44H_0: \mu = 44 \qquad H_1: \mu \neq 44

The symbol ≠\neq makes this a two-tailed test, because a difference in either direction counts as evidence against H0H_0. A test that looks only for a difference in one direction is one-tailed.

The test statistic

For a large sample, the sample mean is approximately normal by the central limit theorem. The test statistic counts how many standard errors the sample mean lies from the claimed mean:

The one-sample zz-test.

z=xˉ−μσ/nz = \frac{\bar{x} - \mu}{\sigma / \sqrt{n}}

where xˉ\bar{x} is the sample mean, μ\mu the claimed mean, σ\sigma the population standard deviation and nn the sample size. This is the formula in the formulae and tables booklet.

Example 2. A sample of 8080 new phones has mean charging time 45.445.4 minutes. The population standard deviation is 3.13.1 minutes. Test the claim that the mean is 4444 minutes at the 5%5\% level.

The standard error is

3.180≈0.3466\frac{3.1}{\sqrt{80}} \approx 0.3466

The test statistic is

z=45.4−440.3466≈4.04z = \frac{45.4 - 44}{0.3466} \approx 4.04

Predict first. The figure draws a normal curve and shades the critical region for a 5%5\% test. Before you move a control, predict what happens to the shaded area when the sample size rises from 1616 to 6464. Write down whether the shaded region grows, shrinks or stays the same, and why.

Figure 1

Test. Set the sample mean to 45.445.4, the standard deviation to 3.13.1 and the sample size to 8080. Read the test statistic and the pp-value. Now raise the sample size and watch both values. Then change the tail to "two tails".

Explain. Write two sentences. The first explains why a larger sample makes the same sample mean give a more extreme test statistic. The second explains why the two-tailed pp-value is twice the one-tailed value.

The p-value and the decision

The pp-value is the probability of getting a result at least as extreme as the one observed, if H0H_0 is true. A small pp-value means the observed result would be unlikely under H0H_0, so it is evidence against H0H_0.

The significance level α\alpha is the risk we accept of rejecting H0H_0 when it is true. The common choice is α=0.05\alpha = 0.05, which is 5%5\%. The rule is:

For Example 2, the two-tailed pp-value is very small, about 0.000050.00005. Since 0.00005<0.050.00005 \lt 0.05, reject H0H_0. There is strong evidence that the mean charging time is not 4444 minutes.

Retaining H0H_0 does not prove that H0H_0 is true. It means the sample did not provide enough evidence against it.

Confidence intervals

A confidence interval gives a range of plausible values for the parameter. A 95%95\% confidence interval for the population mean is

xˉ±1.96σn\bar{x} \pm 1.96\frac{\sigma}{\sqrt{n}}

Example 3. For the phones, build the 95%95\% confidence interval for the mean.

45.4±1.96×0.3466=45.4±0.6845.4 \pm 1.96 \times 0.3466 = 45.4 \pm 0.68 (44.72,46.08)(44.72, 46.08)

The interval does not contain 4444, so a two-tailed test at the 5%5\% level rejects the claim that the mean is 4444. That link always holds: a 95%95\% confidence interval contains exactly the values that a two-tailed test at the 5%5\% level would retain.

For a population proportion pp and a sample proportion p^\hat{p} from a sample of size nn, the 95%95\% confidence interval is

p^±1.96p^(1−p^)n\hat{p} \pm 1.96\sqrt{\frac{\hat{p}(1 - \hat{p})}{n}}

Example 4. A poll of 10001000 voters gives p^=0.52\hat{p} = 0.52. Build the 95%95\% interval.

0.52×0.481000≈0.0158,1.96×0.0158≈0.0310\sqrt{\frac{0.52 \times 0.48}{1000}} \approx 0.0158, \qquad 1.96 \times 0.0158 \approx 0.0310 0.52±0.0310=(0.489,0.551)0.52 \pm 0.0310 = (0.489, 0.551)

Progress check

Back to the chapter problem. Test whether the poll's result is consistent with a 5050-5050 split. Use H0:p=0.5H_0: p = 0.5, H1:p≠0.5H_1: p \neq 0.5 and α=0.05\alpha = 0.05.

The standard error under H0H_0 is

0.5×0.51000≈0.0158\sqrt{\frac{0.5 \times 0.5}{1000}} \approx 0.0158

The test statistic is

z=0.52−0.500.0158≈1.27z = \frac{0.52 - 0.50}{0.0158} \approx 1.27

For a two-tailed test, the pp-value is twice the area to the right of 1.271.27:

p≈2(0.102)=0.204p \approx 2(0.102) = 0.204

Since 0.204>0.050.204 > 0.05, retain H0H_0. The poll's result is consistent with a 5050-5050 split.

That is the resolution of the chapter problem. The poll did not show that Yes would win. A lead of four points is about 1.271.27 standard errors, which is a common distance from the middle. The newspaper read a number inside the noise as if it were a signal.

You should now be able to

Settings

Colour scheme

Light or dark pages. Your colour and layout stay the same.

Colour

The paper, ink and lettering. Your layout stays the same.

Quiet colours
Bold colours
Layout

How pages are arranged. Your colours stay the same.

Reading offline

Keep this book on this device and read it offline.