Put uncertainty to workLesson 16 of 30 · 7 min

How uncertain is the mean?

Construct and interpret a t confidence interval for a population mean.

An estimate from a sample changes when the sample changes. A confidence interval is built by a procedure intended to cover a target population quantity at a stated rate over repeated sampling under its assumptions.

A t interval starts at the sample mean and extends by a margin in either direction. The margin is the estimated standard error multiplied by a value that depends on the sample size and chosen confidence level. The procedure has its stated coverage for independent observations from a normal population. With bigger samples it can also work approximately for some other populations.

The target here is the population mean elapsed time, not the time of the next request. A 95% confidence procedure does not say that 95% of observations lie in the interval. After the interval is computed, frequentist coverage is a property of the procedure, not a probability assigned to the fixed population mean.

A range for which quantity?
Observed range95% interval for mean9598.7102106Elapsed time (ms)
Observed range95% interval for mean9598.7102106Elapsed time (ms)
xˉ  ±  t0.975,n−1sn\bar x\;\pm\;t_{0.975,n-1}\frac{s}{\sqrt n}
Invented sample: range 97–104 ms; 95% t interval for the population mean 98.45–102.55 ms. The two lines describe different quantities. This interval relies on the sampling and distribution assumptions in the lesson.

Should this interval contain nearly every individual reading?

Write a prediction (optional)

Run the prepared example

This page puts the example in the Python editor. Select Run Python with the code unchanged.

Invented data

Editor tools
About Python ↗

Ctrl+Enter or ⌘+Enter runs the code.

What to compare

Compare the two endpoints in 95% t interval for population mean (ms) with Observed range (ms). Which line describes uncertainty about a mean rather than individual times?

Published example output

The site ran the original code to produce this reference. Build environment ↗

Sample mean (ms): 100.5
Estimated SE (ms): 0.866
95% t interval for population mean (ms): 98.452 102.548
Observed range (ms): 97 104

The known observations span 97 to 104 ms. The interval addresses the unknown population mean. With the same observations, higher confidence requires a wider interval.

Change and run again

In the Python editor, change confidence_level = 0.95 to confidence_level = 0.99. Select Run Python again. Subtract the lower endpoint from the upper one for each of the 95% and 99% intervals. What happens to interval width and Observed range (ms)? Return to the Python editor

What this example supports. These eight values are invented. Using a t interval requires a justified independence and distribution model; the calculation itself cannot establish either.

Try a fresh case

A 95% confidence interval for mean height is 169–171 cm. Which interpretation fits?

Choose an answer

Hints for this question
  1. Name the interval’s target.
  2. Distinguish repeated samples from individuals in one sample.
Your notes