Educerie

Educerie · AP · Statistics

AP Statistics 3.7

Carrying Out a Test for a Population Proportion

How can a sample of a few hundred people tell us something reliable about thousands, and how sure can we be?

What you will learn

  • Know that the test statistic is z = (p-hat minus p0) over the square root of p0(1-p0) ÷ n
  • Understand that the formal decision compares the p-value with alpha, and reject means convincing evidence for Ha
  • Know that a test can never show that H0 is true
  • Understand how to write a conclusion in context about Ha with non-definitive wording

You must be able to

  1. Calculate the z-statistic and the p-value for a one-proportion test
  2. Compare the p-value with alpha and make a decision
  3. Write a conclusion in context about the alternative hypothesis
  4. Carry out a complete test in the order the free-response question scores it
  5. Explain why the same data can lead to different decisions at different alpha
  6. Identify wrong conclusions such as accept H0 or prove Ha

In the exam. Section I multiple choice: pick the correct test statistic, compare a p-value with a significance level, or choose the correct conclusion. Section II: Question 3 is often a complete one-proportion test. The marks are split between the setup (3.5), the calculation of zz and the p-value, the comparison of the p-value with α\alpha, and a conclusion in context. Skills: calculate (3.E), justify a claim (4.G).

1The test statistic

The sheet gives the general form: standardized test statistic = (statistic −- parameter) / standard error of the statistic. For one proportion, the parameter is the null value and the standard deviation is the one under H0H_0:

z=p^−p0p0(1−p0)np0 is in both places: the null value, not p-hatz = \frac{\hat{p} - p_0}{\sqrt{\dfrac{p_0(1-p_0)}{n}}} \qquad \textcolor{#838c91}{\text{p0 is in both places: the null value, not p-hat}}

The standard error in a test uses p0p_0. It does not use p^\hat{p}. In an interval (3.3) you do not have a null value, so you use p^\hat{p}. In a test you have one, and the whole calculation assumes H0H_0 is true.

If H0H_0 is true and the conditions hold, zz has approximately a standard normal distribution.

2The significance level and the decision

The significance level, α\alpha, is the probability of rejecting the null hypothesis when it is true. It is chosen before collecting the data. It is often 0.05, sometimes 0.01 or 0.10. The question usually gives it. If it does not, say which you are using.

The decision compares the p-value with α\alpha:

  • p-value ≤α\le \alpha: reject H0H_0. The result is statistically significant.
  • p-value >α> \alpha: fail to reject H0H_0.

Write the comparison with both numbers. "Since 0.057 > 0.05" earns a point that "so we reject" alone does not.

3A full test, start to finish

Use the clinic from 3.5. The clinic's records show that 15% of patients miss appointments. After reminder texts begin, the clinic believes the share is lower. It follows a random sample of 200 patients from its large patient list and finds that 22 missed an appointment. Test at α=0.05\alpha = 0.05.

Procedure. One-sample zz-test for a population proportion.

Parameter and hypotheses. pp = the proportion of all the clinic's patients who miss an appointment after reminder texts begin.

H0:p=0.15H_0 : p = 0.15Ha:p<0.15H_a : p < 0.15

Conditions.

  • Randomization: the patients were a random sample.
  • 10%: the patient list is large, so 200 patients is less than 10% of it.
  • Normality: np0=200(0.15)=30≥10np_0 = 200(0.15) = 30 \ge 10 and n(1−p0)=200(0.85)=170≥10n(1-p_0) = 200(0.85) = 170 \ge 10.

Calculation.

p^=22200=0.11\hat{p} = \frac{22}{200} = 0.11z=0.11−0.150.15(0.85)200=−0.040.0252=−1.58the sample proportion is 1.58 standard deviations below 0.15\begin{aligned}z &= \frac{0.11 - 0.15}{\sqrt{\dfrac{0.15(0.85)}{200}}} \\[6pt] &= \frac{-0.04}{0.0252} \\[6pt] &= -1.58 && \textcolor{#838c91}{\text{the sample proportion is 1.58 standard deviations below 0.15}}\end{aligned}p-value=P(z≤−1.58)=0.057Table A; the lower tail, because Ha is "less than"p\text{-value} = P(z \le -1.58) = 0.057 \qquad \textcolor{#838c91}{\text{Table A; the lower tail, because Ha is "less than"}}
Figure 1. The null distribution of the test statistic z. The observed z = -1.58 lies just inside the 5% cut-off at -1.645; the area to its left, the p-value, is 0.057, which is larger than alpha = 0.05 −3 −2 −1 0 1 2 3 z 5% cut-off z = −1.645 observed z = −1.58 p-value 0.057
Figure 1 · The null distribution of z: the observed z of -1.58 lies just inside the 5% cut-off at -1.645, and the area to its left, the p-value, is 0.057

Figure 1 shows the picture. The clay region is the lowest 5% of the curve, which is where the result would have to fall for the decision to be "reject". The observed zz is just short of it. The shaded area to its left is the p-value.

Decision. Since the p-value of 0.057 is greater than α=0.05\alpha = 0.05, we fail to reject H0H_0.

Conclusion in context. The data do not provide convincing evidence that the proportion of all the clinic's patients who miss an appointment after reminder texts begin is less than 0.15.

The sample proportion, 0.11, is below 0.15. But with only 200 patients, a result that low is not unusual enough if the true proportion is still 0.15. A larger sample might well find the effect.

4A two-sided example, and what α\alpha changes

A newspaper reports that 50% of voters in a county support a measure. A pollster takes a random sample of 300 voters from the county, which has well over 3,000 voters. In the sample, 168 support the measure. Test whether the proportion has changed.

H0:p=0.50Ha:p≠0.50H_0 : p = 0.50 \qquad H_a : p \ne 0.50

Conditions: a random sample; 300 is less than 10% of the voters; np0=300(0.50)=150≥10np_0 = 300(0.50) = 150 \ge 10 and n(1−p0)=150≥10n(1-p_0) = 150 \ge 10.

p^=168300=0.56\hat{p} = \frac{168}{300} = 0.56z=0.56−0.500.50(0.50)300=0.060.0289=2.08\begin{aligned}z &= \frac{0.56 - 0.50}{\sqrt{\dfrac{0.50(0.50)}{300}}} \\[6pt] &= \frac{0.06}{0.0289} \\[6pt] &= 2.08\end{aligned}p-value=2 P(z≥2.08)=2(0.0188)=0.038both tails, because Ha is "not equal to"p\text{-value} = 2\,P(z \ge 2.08) = 2(0.0188) = 0.038 \qquad \textcolor{#838c91}{\text{both tails, because Ha is "not equal to"}}

The decision depends on α\alpha.

  • At α=0.05\alpha = 0.05: the p-value of 0.038 is less than 0.05, so reject H0H_0. There is convincing evidence that the proportion of all voters in the county who support the measure is different from 0.50.
  • At α=0.01\alpha = 0.01: the p-value of 0.038 is greater than 0.01, so fail to reject H0H_0. The data do not provide convincing evidence of a difference.

The same data lead to different decisions at different levels. That is why α\alpha must be fixed before the data, not after.

5Tests and intervals agree

The 95% interval for this sample is 0.56±1.960.56(0.44)/300=(0.504,0.616)0.56 \pm 1.96\sqrt{0.56(0.44)/300} = (0.504, 0.616). The value 0.50 is just outside it. That matches the rejection of H0:p=0.50H_0: p = 0.50 at the 5% level in a two-sided test.

This is not an accident. A two-sided test at α\alpha and a confidence interval at 1−α1-\alpha tell the same story about a value p0p_0. But the two procedures use slightly different standard errors (a test uses p0p_0, an interval uses p^\hat{p}), so on a close call they can occasionally differ.

6Writing the conclusion

A good conclusion has these parts.

  1. The decision, with the comparison of the p-value and α\alpha.
  2. The meaning in terms of HaH_a. The conclusion is about the alternative, not the null.
  3. Non-definitive language. "There is convincing evidence …\ldots" or "The data do not provide convincing evidence …\ldots".
  4. The parameter and the population in context.

Reject H0H_0 means: there is convincing statistical evidence for HaH_a.

Fail to reject H0H_0 means: there is not convincing statistical evidence for HaH_a.

Never say:

  • "We accept H0H_0." A test cannot show the null is true.
  • "We have proven HaH_a." Evidence can be convincing, never certain.
  • "There is no difference." A failure to find evidence is not evidence of no difference.

A tempting phrase after a large p-value is "the proportion is 0.15." Resist it. The data are consistent with 0.15. They are also consistent with 0.14, 0.16 and many others.

7The test statistic, the p-value and the sample size

A bigger sample with the same p^\hat{p} gives a larger ∣z∣|z| and a smaller p-value. Suppose the clinic had followed 800 patients and still found 11% missing appointments:

z=0.11−0.150.15(0.85)/800=−3.17the same sample proportion, now 3.17 standard deviations from 0.15z = \frac{0.11 - 0.15}{\sqrt{0.15(0.85)/800}} = -3.17 \qquad \textcolor{#838c91}{\text{the same sample proportion, now 3.17 standard deviations from 0.15}}

The p-value falls to 0.0008. The effect is the same size, and the evidence is much stronger. Evidence depends on both the size of the difference and the sample size.

Practice questions

30 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.