intermediate 20 minutes

Confidence Intervals

Learn how to construct and interpret confidence intervals for population parameters. Understand margin of error and confidence level.

On This Page
Advertisement

What is a Confidence Interval?

A confidence interval is a range of values that likely contains an unknown population parameter. Instead of providing a single point estimate, confidence intervals give us a range with an associated confidence level.

For example, instead of saying “the average height is 170 cm,” we might say “we are 95% confident that the average height is between 168 cm and 172 cm.”

Components of a Confidence Interval

Every confidence interval consists of three key components:

1. Point Estimate

The sample statistic used to estimate the population parameter (e.g., sample mean xˉ\bar{x})

2. Margin of Error

The amount we add and subtract from the point estimate to create the interval

3. Confidence Level

The probability that the interval contains the true population parameter (commonly 90%, 95%, or 99%)

General Form of Confidence Interval

Point Estimate±Margin of Error\text{Point Estimate} \pm \text{Margin of Error}

Confidence Interval for a Mean

The most common type of confidence interval is for a population mean μ\mu.

When Population Standard Deviation (σ) is Known

CI for Mean (σ known)

xˉ±zα/2σn\bar{x} \pm z_{\alpha/2} \cdot \frac{\sigma}{\sqrt{n}}

Where:

  • xˉ\bar{x} = sample mean
  • zα/2z_{\alpha/2} = critical z-value (1.96 for 95% confidence)
  • σ\sigma = population standard deviation
  • nn = sample size
Computing a 95% CI with Known σ

A manufacturer wants to estimate the average weight of cereal boxes. A sample of 36 boxes has a mean weight of 500g. The population standard deviation is known to be 15g.

Solution:

  • Sample mean: xˉ=500\bar{x} = 500 g
  • Population SD: σ=15\sigma = 15 g
  • Sample size: n=36n = 36
  • For 95% CI: z0.025=1.96z_{0.025} = 1.96

Margin of Error: ME=1.96×1536=1.96×2.5=4.9 gME = 1.96 \times \frac{15}{\sqrt{36}} = 1.96 \times 2.5 = 4.9 \text{ g}

95% Confidence Interval: 500±4.9=(495.1,504.9) g500 \pm 4.9 = (495.1, 504.9) \text{ g}

Interpretation: We are 95% confident that the true average weight of all cereal boxes is between 495.1g and 504.9g.

When Population Standard Deviation (σ) is Unknown

In most real-world situations, we don’t know the population standard deviation. Instead, we use the sample standard deviation ss and the t-distribution.

CI for Mean (σ unknown)

xˉ±tα/2,dfsn\bar{x} \pm t_{\alpha/2, df} \cdot \frac{s}{\sqrt{n}}

Where:

  • ss = sample standard deviation
  • tα/2,dft_{\alpha/2, df} = critical t-value with degrees of freedom df=n1df = n - 1
Computing a 95% CI with Unknown σ

A researcher measures the reaction times of 25 participants and finds:

  • Sample mean: xˉ=0.45\bar{x} = 0.45 seconds
  • Sample SD: s=0.08s = 0.08 seconds

Solution:

  • Sample size: n=25n = 25
  • Degrees of freedom: df=24df = 24
  • For 95% CI with df=24df = 24: t0.025,24=2.064t_{0.025, 24} = 2.064

Margin of Error: ME=2.064×0.0825=2.064×0.016=0.033 secondsME = 2.064 \times \frac{0.08}{\sqrt{25}} = 2.064 \times 0.016 = 0.033 \text{ seconds}

95% Confidence Interval: 0.45±0.033=(0.417,0.483) seconds0.45 \pm 0.033 = (0.417, 0.483) \text{ seconds}

Interpretation: We are 95% confident that the true average reaction time is between 0.417 and 0.483 seconds.

Common Confidence Levels

Confidence Levelz-valueInterpretation
90%1.645Less precise, but more certain to capture true parameter
95%1.96Standard choice, good balance
99%2.576More precise, but wider interval

Factors Affecting Interval Width

The width of a confidence interval depends on three factors:

1. Sample Size (n)

  • Larger samplesNarrower intervals
  • Standard error decreases as 1/n1/\sqrt{n}

2. Confidence Level

  • Higher confidenceWider intervals
  • More critical z or t value needed

3. Population Variability (σ or s)

  • More variabilityWider intervals
  • Less certainty about the true parameter
Effect of Sample Size

Consider two studies with the same mean (100) and standard deviation (15):

Study A: n=25n = 25

  • ME=1.96×1525=5.88ME = 1.96 \times \frac{15}{\sqrt{25}} = 5.88
  • CI=(94.12,105.88)CI = (94.12, 105.88) — Width = 11.76

Study B: n=100n = 100

  • ME=1.96×15100=2.94ME = 1.96 \times \frac{15}{\sqrt{100}} = 2.94
  • CI=(97.06,102.94)CI = (97.06, 102.94) — Width = 5.88

Result: Quadrupling the sample size cuts the interval width in half!

Interpreting Confidence Intervals

✅ Correct Interpretations

  1. “We are 95% confident that the true population mean lies between [a] and [b].”
  2. “If we repeated this study many times, approximately 95% of the constructed intervals would contain the true mean.”

❌ Incorrect Interpretations

  1. “There is a 95% probability that the true mean is in this interval.” (The parameter is fixed, not random!)
  2. “95% of the data falls in this interval.” (This describes the data distribution, not the parameter)

Confidence Intervals for Proportions

We can also construct confidence intervals for population proportions pp.

CI for Proportion

p^±zα/2p^(1p^)n\hat{p} \pm z_{\alpha/2} \cdot \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}

Where p^\hat{p} is the sample proportion.

Proportion Confidence Interval

In a survey of 500 voters, 280 support a particular candidate.

Solution:

  • Sample proportion: p^=280500=0.56\hat{p} = \frac{280}{500} = 0.56
  • Sample size: n=500n = 500
  • For 95% CI: z=1.96z = 1.96

Margin of Error: ME=1.96×0.56(0.44)500=1.96×0.0222=0.044ME = 1.96 \times \sqrt{\frac{0.56(0.44)}{500}} = 1.96 \times 0.0222 = 0.044

95% Confidence Interval: 0.56±0.044=(0.516,0.604)0.56 \pm 0.044 = (0.516, 0.604)

Interpretation: We are 95% confident that between 51.6% and 60.4% of all voters support the candidate.

Sample Size Determination

Sometimes we want to determine how large a sample we need to achieve a desired margin of error.

Sample Size for Mean

n=(zα/2σME)2n = \left(\frac{z_{\alpha/2} \cdot \sigma}{ME}\right)^2

Determining Required Sample Size

A researcher wants to estimate the average IQ within ±2 points with 95% confidence. Assuming σ=15\sigma = 15:

n=(1.96×152)2=(14.7)2=216.09n = \left(\frac{1.96 \times 15}{2}\right)^2 = (14.7)^2 = 216.09

Result: Need at least 217 participants.

Common Mistakes to Avoid

  1. Confusing confidence level with probability: The interval either contains the parameter or it doesn’t; the confidence level refers to the long-run success rate of the method.

  2. Using z instead of t: When σ is unknown and sample size is small, always use the t-distribution.

  3. Ignoring assumptions: Confidence intervals assume random sampling and approximately normal distributions (or large sample sizes).

  4. Misinterpreting width: A wider interval doesn’t mean we’re less certain; it means we’re being more cautious.

Summary

In this lesson, you learned:

  • Confidence intervals provide a range of plausible values for population parameters
  • The interval is constructed as: point estimate ± margin of error
  • Common confidence levels are 90%, 95%, and 99%
  • Use z-distribution when σ is known, t-distribution when unknown
  • Interval width depends on sample size, confidence level, and variability
  • Larger samples produce narrower, more precise intervals

Next Steps

Continue your learning with:

Advertisement

Was this lesson helpful?

Help us improve by sharing your feedback or spreading the word.