Data Science · Intermediate level

Intermediate level · Module 3: Statistical Inference · Lesson 1 of 3

Confidence Intervals

Quantify the precision of estimates with standard errors and confidence intervals.

In this lesson you will

  • Calculate confidence intervals for proportions and means
  • Interpret interval width and overlap correctly

Key concepts

standard error95% confidence intervalinterval widthcomparing intervals

The lesson

The standard error measures how much an estimate would vary between samples. For a proportion p from n respondents it is √(p(1 − p)/n); a 95% interval is roughly the estimate ± 1.96 standard errors.

Intervals narrow as samples grow: quadrupling the sample halves the width.

Overlapping intervals do not prove that two groups are the same, and non-overlapping intervals are only a rough sign of a difference. Use a proper test to compare groups.

Step by step

  1. Calculate a proportion's standard error by hand.
  2. Build the 95% interval.
  3. Calculate intervals for each district.
  4. Compare a large and a small district.
Worked calculation

How precise is '42% of households lack safe water'?

A 95% confidence interval for a survey proportion, worked step by step.

Simple random sample of 400 households; 168 report no access to safe water (illustrative)
ItemWorkingAmount
Sample proportion p168 ÷ 4000.42
Standard error√(0.42 × 0.58 ÷ 400)0.0247
Margin of error (95%)1.96 × 0.02470.048
Lower limit0.42 − 0.04837.2%
Upper limit0.42 + 0.04846.8%
95% confidence intervalrounded37% to 47%

Explanation

Plain language: our best estimate is 42% of households, and the true share in the county is very likely between 37% and 47%.

With only 100 households the margin would be about twice as wide (roughly ±10 points). This formula assumes a simple random sample; clustered or weighted surveys need survey-aware methods, which usually give wider intervals.

Check your understanding

The interval is centred on the estimate: 42% − 4.8 points and 42% + 4.8 points.

Practice activity

Report attendance indicators with 95% confidence intervals.

Expected result: Correct intervals with plain-language statements.

Check your understanding

  1. How does the interval width change if the sample size is multiplied by four?

    Show answer

    It is roughly halved.

  2. Do overlapping intervals prove two groups are the same?

    Show answer

    No.

Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.