Skip to content
Scintria
ToolsGrant writerFunding
HomeLiteratureClinical trialsEvidence LabProtocol packData analysisLearnProjectsLibraryReferencesApplications
Start free
ScintriaStart free

Learn / Biostatistics / Sampling and estimation

Confidence intervals for means and proportions

14 minute read · 6-question quiz

Download this lesson as a colour Word or PDF study guide with the figures and answers. Included in paid plans; reading and quizzes stay free.Sign in

What you will learn

  • Calculate 95% confidence intervals for a mean and a proportion

  • Interpret a confidence interval correctly, and spot the common misreadings

  • Understand how sample size, variability and confidence level change the width

A single number (a point estimate) such as "27% of women are anaemic" hides its uncertainty. A confidence interval (CI) gives a range of values that are plausible for the true population value, given the data. A 95% CI is the standard.

The general recipe

estimate ± (critical value) × SE

The critical value is 1.96 for a 95% interval when the normal approximation holds. For means from small samples, we use the t distribution with n - 1 degrees of freedom, which has fatter tails and gives a slightly larger critical value (2.064 for n = 25), approaching 1.96 as n grows.

Worked example 1: a mean

A sample of 100 adults has mean SBP 120 mmHg and SD 15 mmHg.

SE = 15/sqrt(100) = 1.5

95% CI: 120 ± 1.96 × 1.5 = 120 ± 2.94, so 117.1 to 122.9 mmHg.

Worked example 2: a small sample (t distribution)

Twenty-five children have mean haemoglobin rise of 8.4 g/dL after 8 weeks with SD 2.5.

SE = 2.5/sqrt(25) = 0.5. With 24 degrees of freedom, t_0.975 = 2.064.

95% CI: 8.4 ± 2.064 × 0.5, so 7.37 to 9.43 g/dL. (Using 1.96 would give 7.42 to 9.38 and understate the uncertainty a little.)

Worked example 3: a proportion

In a survey of 200 women, 54 are anaemic: \hat p = 54/200 = 0.27.

SE = sqrt(0.27 × 0.73 / 200) = 0.0314

95% CI: 0.27 ± 1.96 × 0.0314, so 20.8% to 33.2%.

When the proportion is close to 0 or 1, or n is small, use a Wilson or exact (Clopper-Pearson) interval instead; the simple formula can even go below 0%.

What a 95% CI means

If you repeated the study many times and calculated a 95% CI each time, about 95% of those intervals would contain the true value. The figure shows ten such studies: each drew 100 adults from a population whose true mean SBP is 120. Nine of ten intervals contain 120; one (sample 5) misses. That is what "95%" promises on average, not a guarantee for every study.

StudyEstimate (95% CI)Sample 1117.4 (114.8–120)Sample 2118.6 (116–121.2)Sample 3118 (115–121.1)Sample 4119.6 (116.8–122.3)Sample 5116.7 (113.8–119.7)Sample 6117.6 (115.1–120.1)Sample 7120.6 (117.7–123.5)Sample 8118.7 (115.6–121.8)Sample 9119.5 (116.8–122.2)Sample 10122.3 (119.6–125.1)115117.5120122.5125Mean SBP (mmHg); the line marks the true value, 120
Ten simulated studies. Sample 5's interval (113.8 to 119.7) misses the true mean.

Three misreadings to avoid

  1. "There is a 95% probability that the true value lies in this interval." Strictly, the true value is fixed; the interval is what varies. Many textbooks tolerate the looser reading, but never say "95% of patients have values in the interval" - that is a different thing (a reference range).
  2. "Non-overlapping intervals are needed for a significant difference." Wrong direction: overlapping intervals can still hide a significant difference. Compare groups with the CI of the difference.
  3. "The CI covers the range of the data." It describes the estimate, not individual people.

What changes the width?

width ≈ 2 × 1.96 × (s)/(sqrt(n))

  • Larger n gives a narrower interval (as the square root).
  • More variable data (larger s) gives a wider interval.
  • Higher confidence needs a bigger critical value: 90% uses 1.645, 95% uses 1.96, 99% uses 2.576. Greater confidence costs precision.

Why CIs are better than p-values alone

A CI shows both the size of an effect and the uncertainty. A mean difference of 0.3 mmHg with CI -0.1 to 0.7 and a difference of 8 mmHg with CI -2 to 18 might both give p > 0.05, but they say entirely different things: the first excludes any important effect, the second is simply inconclusive. Modern reporting standards (CONSORT, STROBE) require intervals for the main results.

Reading a CI for a difference

If the 95% CI for a difference excludes 0 (or for a ratio excludes 1), the result is statistically significant at the 5% level. More usefully, ask whether the whole interval lies in a range that matters clinically.

Summary

  • A CI is estimate ± critical value × SE: 1.96 for large samples, t for small samples.

  • 95% of intervals constructed this way over repeated studies contain the true value.

  • Width falls with larger n and rises with larger variability and higher confidence level.

  • Prefer intervals to bare p-values: they show effect size and uncertainty together.

Check your understanding

Question 1
1

A study reports mean 50 with SE 2. The approximate 95% CI is:

Question 2
2

Why use the t distribution for a mean from 12 patients?

Question 3
3

Moving from a 95% to a 99% confidence level makes the interval:

Question 4
4

A proportion is 0.10 from n = 50. Why might the simple formula be unsuitable?

Question 5
5

A 95% CI for a risk difference is -2% to 9%. What can you conclude?

Question 6
6

Which statement about a 95% CI is correct?

Draft study guide. Spotted an error or something unclear? Tell us at hello@scintria.com. This is educational material, not clinical or regulatory advice.

Sampling variation, standard error and the central limit theoremThe logic of a significance test