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 confidence interval for a mean and for a proportion; interpret a -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 . The claim we are looking for evidence of is the alternative hypothesis, written .
Example 1. A company claims that the mean charging time of its new phone is minutes. A sample suggests it may be different. Write the hypotheses.
The symbol makes this a two-tailed test, because a difference in either direction counts as evidence against . 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 -test.
where is the sample mean, the claimed mean, the population standard deviation and the sample size. This is the formula in the formulae and tables booklet.
Example 2. A sample of new phones has mean charging time minutes. The population standard deviation is minutes. Test the claim that the mean is minutes at the level.
The standard error is
The test statistic is
Predict first. The figure draws a normal curve and shades the critical region for a test. Before you move a control, predict what happens to the shaded area when the sample size rises from to . Write down whether the shaded region grows, shrinks or stays the same, and why.
Test. Set the sample mean to , the standard deviation to and the sample size to . Read the test statistic and the -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 -value is twice the one-tailed value.
The p-value and the decision
The -value is the probability of getting a result at least as extreme as the one observed, if is true. A small -value means the observed result would be unlikely under , so it is evidence against .
The significance level is the risk we accept of rejecting when it is true. The common choice is , which is . The rule is:
- if , reject ;
- if , retain .
For Example 2, the two-tailed -value is very small, about . Since , reject . There is strong evidence that the mean charging time is not minutes.
Retaining does not prove that 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 confidence interval for the population mean is
Example 3. For the phones, build the confidence interval for the mean.
The interval does not contain , so a two-tailed test at the level rejects the claim that the mean is . That link always holds: a confidence interval contains exactly the values that a two-tailed test at the level would retain.
For a population proportion and a sample proportion from a sample of size , the confidence interval is
Example 4. A poll of voters gives . Build the interval.
Progress check
Back to the chapter problem. Test whether the poll's result is consistent with a - split. Use , and .
The standard error under is
The test statistic is
For a two-tailed test, the -value is twice the area to the right of :
Since , retain . The poll's result is consistent with a - 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 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
- write a null and an alternative hypothesis;
- tell a one-tailed test from a two-tailed test;
- carry out a large-sample -test of a population mean;
- interpret a -value against a significance level;
- build a confidence interval for a mean and for a proportion;
- explain the link between a confidence interval and a two-tailed test.