Topic contents

Lesson 3

Confidence level: what does 95% really mean?

Randomly select 40 male students and measure their heights. Use the sample mean height to estimate the true mean height μ of all male students at the university. Compare z and t intervals in a teaching model with independent random sampling from a normal population.

Simulation settings

Try it

Confidence level

The simulation draws independent observations from a normal distribution with mean μ and standard deviation σ, rather than sampling from an actual university roster. σ generates the simulated data; in the two “unknown σ” modes, the interval calculation uses only the sample standard deviation s. Changing settings restarts the simulation. Space = draw 1 sample.

Confidence intervals from repeated samples

168170172174176Mean height (cm)True mean height μ = 172 cmClick “Draw 1 sample” to add intervals here one at a time
  • Interval covers μ
  • Interval misses μ
  • Dashed line = true mean height μ
Each dot is the sample mean height x̄ for that sample, and each horizontal line is its interval. The newest sample is at the top; the plot retains at most the 100 most recent samples.

Sampling distribution of the sample mean

01234Countμ − 1.96·SEμμ + 1.96·SE168170172174176Sample mean height x̄ (cm)Sampling results accumulate here as a histogram
  • Inside the shaded region (interval covers μ)
  • Outside the shaded region (interval misses μ)
x̄ falling within μ ± 1.96·SE is equivalent to this sample's interval covering μ. The curve is the theoretical sampling distribution (a bell-shaped curve centered at μ); the central shaded region has area 95%.

What does a confidence level of 95% mean?

If we independently draw 100 random samples using the current method and construct a confidence interval at confidence level 95% each time, then on average in the long run about 95 intervals contain the fixed true population value (the true population mean height μ = 172 cm).

Click “Draw 100 samples,” observe the changes in both plots, then check the observed coverage proportion. A run of 100 samples is just one simulation: the actual number covering the true value fluctuates randomly and need not equal exactly 95.

Repeated-sampling results

Total samples drawn
0(students per sample: 40)
Covers μ
0Number of intervals
Misses μ
0Number of intervals
Coverage proportion
—Theoretical: 95%

Interval width: 3.72 cm for every interval

Most recent sample

No sample drawn yet. Click “Draw 1 sample” to start.

Confidence interval formula and calculation for this sample

Confidence interval formula for the current estimation method

xˉ±z1−α2×σn\bar{x}\pm z_{1-\frac{\alpha}{2}}\times\frac{\sigma}{\sqrt{n}}

Known population standard deviation σ: Use the standard normal critical value z = 1.96. Confidence level 95%; standard error (the standard deviation of the statistic's sampling distribution) = σ/√n; margin of error Δ (the interval's half-width) = critical value × standard error. Every interval has the same width in this teaching model.

After sampling, the most recent substitution calculation appears here

Before sampling

Under this normal-sampling model, this procedure covers the fixed true value μ with probability 95%.

After sampling

μ is fixed, and the endpoints have been determined. The interval either covers it or misses it; the classical confidence level does not assign a probability to this fixed interval.

After many repetitions

The cumulative coverage proportion approaches 95% in the long run. It fluctuates with finite sampling; exactly 95 of every 100 intervals need not cover the true value.

References and model conventions

This lesson simulates independent samples from one normal population. Known-σ z intervals use the original lesson's rounded critical values, so theoretical coverage is approximately the nominal level; unknown-σ t intervals attain the nominal level under this model. Substituting s for σ while retaining a z critical value is an approximation that does not guarantee nominal coverage in small samples. Finite simulation runs also fluctuate randomly.

Simulation settings

95% · z interval · n = 40 · Samples: 0