Lesson 3 of 7 · 16 min

Calculating an approximate confidence interval

Build the approximate confidence interval p^±zp^(1−p^)n\hat{p} \pm z\sqrt{\frac{\hat{p}(1-\hat{p})}{n}} from the normal approximation, and calculate it accurately from survey data.

What you will be able to do

  • Explain where the interval p^±zp^(1−p^)n\hat{p} \pm z\sqrt{\frac{\hat{p}(1-\hat{p})}{n}} comes from and why it is approximate.
  • Calculate a confidence interval for pp at a given confidence level, with and without technology.
  • State the conditions under which the interval is reasonable.

You now have both ingredients. From Topic 4, for a large random sample p^\hat{p} is approximately normal with mean pp and standard deviation p(1−p)n\sqrt{\frac{p(1-p)}{n}}. From the last lesson, 95% of a standard normal distribution lies between −1.96-1.96 and 1.961.96. Put them together and you can say how far p^\hat{p} usually lands from pp.

In 95% of samples, p^\hat{p} is within 1.961.96 standard deviations of pp. Turn that round: in 95% of samples, pp is within 1.961.96 standard deviations of p^\hat{p}. That is a range we can calculate from one sample.

The distribution of p^\hat{p} for samples of 1200 when p=0.62p = 0.62 (standard deviation 0.014). 95% of samples give a p^\hat{p} in the shaded band p±1.96×0.014p \pm 1.96 \times 0.014, so for 95% of samples the interval p^±1.96×0.014\hat{p} \pm 1.96 \times 0.014 reaches back to pp.

The derivation

For a large sample, Z=p^−pp(1−p)/nZ = \dfrac{\hat{p} - p}{\sqrt{p(1-p)/n}} is approximately N(0,1)N(0, 1), so

P(−z<p^−pp(1−p)/n<z)≈C.P\left(-z < \frac{\hat{p} - p}{\sqrt{p(1-p)/n}} < z\right) \approx C.

Multiply through by the standard deviation and rearrange for pp:

P(p^−zp(1−p)n<p<p^+zp(1−p)n)≈C.P\left(\hat{p} - z\sqrt{\tfrac{p(1-p)}{n}} < p < \hat{p} + z\sqrt{\tfrac{p(1-p)}{n}}\right) \approx C.

The endpoints still contain the unknown pp, so replace it with its estimate p^\hat{p}. The result is the approximate confidence interval. It is approximate twice over: p^\hat{p} is only approximately normal, and p^\hat{p} stands in for pp in the standard deviation.

Key idea

Approximate confidence interval for p

(p^−zp^(1−p^)n, p^+zp^(1−p^)n)\left(\hat{p} - z\sqrt{\frac{\hat{p}(1-\hat{p})}{n}},\ \hat{p} + z\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\right)

where zz is the standard normal quantile for the confidence level: 1.6451.645 for 90%, 1.961.96 for 95%, 2.5762.576 for 99%. The quantity p^(1−p^)n\sqrt{\frac{\hat{p}(1-\hat{p})}{n}} is the standard error of p^\hat{p}. The interval is often written p^±zp^(1−p^)n\hat{p} \pm z\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}.

Calculating a confidence interval

  1. Find p^\hat{p} and nn

    p^=Xn\hat{p} = \frac{X}{n} as a decimal, not a percentage.

  2. Find zz

    From the confidence level: given, recalled, or invNorm(1+C2)\text{invNorm}\left(\frac{1+C}{2}\right).

  3. Calculate the standard error

    p^(1−p^)n\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}. Keep full calculator accuracy.

  4. Multiply by z to get the margin of error

    E=z×standard errorE = z \times \text{standard error}.

  5. Write the interval

    (p^−E,p^+E)(\hat{p} - E, \hat{p} + E), rounded at the end, usually to 3 decimal places.

Worked example

A 95% confidence interval from a survey

  • Simple familiar
  • Technology active

In a random sample of 1200 Queensland adults, 744 wore sunscreen the last time they spent more than an hour outdoors. Calculate an approximate 95% confidence interval for the proportion of all Queensland adults who wore sunscreen. Use z=1.96z = 1.96 and give the endpoints correct to 3 decimal places.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. p^=Xn\hat{p} = \frac{X}{n}.

  2. Standard error p^(1−p^)n\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}, kept to full accuracy.

  3. E=z×E = z \times standard error.

  4. (p^−E,p^+E)(\hat{p} - E, \hat{p} + E), rounded at the end.

Watch out for

  • Using 62 instead of 0.62 inside the square root.

  • Rounding the standard error to 0.01 before multiplying by 1.96.

Without a calculator: a random sample of 600 people gives p^=0.4\hat{p} = 0.4. Using z=1.96z = 1.96, find the 95% confidence interval for pp. Give the exact endpoints.

Common mistake

Three slips that cost marks

  • Using a percentage: 56×441500\sqrt{\frac{56 \times 44}{1500}} gives nonsense. Use p^=0.56\hat{p} = 0.56.
  • 'Rounding the standard error early: for p^=0.56\hat{p} = 0.56 and n=1500n = 1500 it is 0.012817…; rounding it to 0.01 gives (0.540,0.580)(0.540, 0.580) instead of (0.535,0.585)(0.535, 0.585). Keep full accuracy until the end.'
  • Missing the root: 1.96×0.56×0.4415001.96 \times \frac{0.56 \times 0.44}{1500} gives a margin of about 0.0003, far too small for a poll of 1500.

In a random sample of 500 Queensland nurses, 180 said they planned to leave the profession within five years. Calculate a 95% confidence interval for the proportion of all Queensland nurses who plan to leave within five years. Use z=1.96z = 1.96 and give the endpoints correct to 3 decimal places.

Worked example

A 99% interval, and why it is wider

  • Complex familiar
  • Technology active

In a random sample of 900 Queensland five-year-olds, 783 were fully vaccinated.

(a) Calculate an approximate 99% confidence interval for the proportion of all Queensland five-year-olds who are fully vaccinated, correct to 3 decimal places.

(b) The 95% interval from the same data is (0.848,0.892)(0.848, 0.892). Explain why the 99% interval is wider.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Find zz for the confidence level.

  2. Same p^\hat{p} and nn means the same standard error, so the margin is proportional to zz.

Watch out for

  • Thinking a 99% interval should be narrower because it is "more accurate".

Note

When is the approximation reasonable?

The interval relies on p^\hat{p} being approximately normal, which needs a random sample and a large enough nn. A common guide is that np^n\hat{p} and n(1−p^)n(1-\hat{p}) should both be at least 10. With 744 successes and 456 failures in the sunscreen survey, that is easily met. A sample of 20 with 2 successes is not, and its interval would be unreliable.

Without technology

Paper 1 questions use numbers whose standard error is a tidy square root, such as 0.4×0.6600=0.0004=0.02\sqrt{\frac{0.4 \times 0.6}{600}} = \sqrt{0.0004} = 0.02, and give zz. Work exactly, then multiply by zz.

With technology

Most calculators have a one-proportion interval (often called 1-PropZInt): enter XX, nn and the level CC. Still write the formula with the numbers substituted, so the marker sees your method. The calculator uses zz to full accuracy, so its endpoints can differ from yours in the fourth decimal place.

Summary

  • The approximate confidence interval for pp is p^±zp^(1−p^)n\hat{p} \pm z\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}.

  • It comes from the normal approximation to p^\hat{p}, with p^\hat{p} replacing pp in the standard deviation.

  • Steps: p^\hat{p}, zz, standard error, margin EE, then (p^−E,p^+E)(\hat{p} - E, \hat{p} + E), rounded at the end.

  • It needs a random sample and a large enough nn (np^n\hat{p} and n(1−p^)n(1-\hat{p}) both at least about 10).

  • The interval is centred on p^\hat{p}; a 99% interval from the same data is wider than a 95% one.

Finished the lesson?

Try the 2 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 3 of 70% read

Save your progress with a free account