hanegreefs.com/ statistics II
Home / Chapters / 03
Chapter 03 · Course ch. 11

Confidence intervals for means

The Central Limit Theorem, Gosset's t and the one-sample t-interval.

About 15 min read · Lecture material: HOC 3

Priority labels: ImportantNeutralLess important show where to spend revision time.

From proportions to meansNeutral

The logic of the previous chapter carries over unchanged; only the ingredients change. The parameter is now a mean μ, the statistic is the sample mean ȳ, and the reference model becomes Student's t rather than the Normal.

ProportionMean
DataCategorical (success/failure)Quantitative
Parameter → statisticp → p̂μ → ȳ
SD of the statistic (known)√(pq/n)σ/√n
Standard error (estimated)√(p̂q̂/n)s/√n
Reference modelNormal (z)Student's t, df = n − 1

The Central Limit Theorem and the meanImportant

Averages of independent observations become approximately Normal as n grows, whatever the population looks like. The CLT is about the distribution of sample means, not of the raw data. Heavier skew needs a bigger n before the approximation is good; very skewed data can need well over a hundred observations.

Formula
E(ȳ) = μ, SD(ȳ) = σ / √n

Averaging cancels noise, hence the √n. In practice σ is unknown, so you estimate it with s and report the standard error SE(ȳ) = s/√n. With s ≈ 9.84, n = 25 gives SE ≈ 1.97, while n = 100 gives ≈ 0.98: four times the data, half the uncertainty.

Why t instead of zImportant

Swapping σ for s adds a second source of randomness, particularly in small samples. William Gosset (writing as "Student", 1908) showed that the standardised mean then follows a distribution with heavier tails than the Normal.

Formula
t = (ȳ − μ) / (s / √n), df = n − 1
  • t is symmetric, bell-shaped and centred at 0; fewer degrees of freedom means fatter tails.
  • As df grows, t converges to the standard Normal.
  • For the same confidence level t* > z*, so t-intervals are wider. Use t whenever σ is estimated — in this course, practically always.

Why n − 1? The deviations from ȳ are forced to add to zero, so only n − 1 of them are free. One degree of freedom is spent for each parameter estimated from the same data.

Confidencez*t* (df 9)t* (df 29)
90%1.6451.8331.699
95%1.9602.2622.045
99%2.5763.2502.756

The one-sample t-intervalImportant

Formula
ȳ ± t*ₙ₋₁ · s/√n
Worked example

Average customer age

A survey of 25 customers gives ȳ = 31.84 years and s = 9.84 years. Find a 95% interval for the mean age.

1

Standard error

SE = 9.84 / √25 = 1.968
2

Critical value

df = 24 → t* = 2.064 (table, or invT(0.975, 24))
3

Margin and interval

ME = 2.064 × 1.968 ≈ 4.06 → [27.78, 35.90]
Answer

We are 95% confident that the mean customer age is between about 27.8 and 35.9 years.

Given a reported interval [L, U] you can work backwards: ȳ = (L + U)/2 and ME = (U − L)/2.

Conditions to check firstImportant

  • Independence. Randomisation, plus the 10% condition when the population is small. You judge this from how the data were gathered; the data cannot prove it.
  • Nearly Normal. Inspect a histogram, boxplot or Normal probability plot of the sample.
Sample sizeWhat you need
n < 15Very nearly Normal: no outliers, no visible skew
15 – 40Unimodal and reasonably symmetric
40 – 100Fine unless extremely skewed; mention outliers
100 +Generally safe; still watch outliers

Bimodal data suggest two mixed groups (split them). Strong skew may call for a transformation or a non-parametric method (chapter 11). A genuine outlier should not be deleted silently: analyse with and without it.

What controls the widthImportant

  • More confidence → larger t* → wider.
  • Larger n → smaller SE → narrower.
  • More variability (bigger s) → wider.

Misreadings to avoid: "95% of customers are between 27.8 and 35.9" (the interval is about the mean, not individuals) and "there is a 95% chance μ is in here" (μ is fixed).

Sample size for a target marginImportant

Before collecting data df is unknown, so use z* in place of t* and bring an estimate of s from a pilot study, history or expert knowledge.

Formula
n ≈ ( z* · s / ME )² (round up)
Worked example

Tightening the age interval

With s ≈ 9.84, how many customers give a 95% margin of 2 years?

1

Apply the formula

n ≈ (1.96 × 9.84 / 2)² = 9.643² ≈ 92.99
Answer

Round up to 93 customers. The realised margin will differ slightly because the new s and t* differ.

Bootstrap interval (optional reading)Less important

The lecturer flags the bootstrap as interesting but not examinable. Idea: resample the data with replacement many times, record each resample's mean, and take the middle 95% of those means as the interval. It needs no Normality assumption but does need software and a representative sample.

Tools: TI-84 and RNeutral

TI-84: STAT ▸ TESTS ▸ 8:TInterval (data or summary statistics); critical values via invT(area left, df). R: the interval is part of the t-test output.

t.test(x, conf.level = 0.95)$conf.int qt(0.975, df = 24) # t* for 95%, df = 24 ceiling((qnorm(0.975) * 9.84 / 2)^2)

Key takeaways

  • SE(ȳ) = s/√n; standardising ȳ with s gives a t statistic with n − 1 degrees of freedom.
  • Interval = ȳ ± t*·SE; t-intervals are wider than z-intervals, especially for small n.
  • Check independence and near-Normality (more strictly for small n); plan n with (z*s/ME)².
Question
Tap or press space to reveal
Answer
Did you know it?

Multiple choice

Ch 03 · Question 1

As df increases, the t-distribution…

Why: t converges to z.
Ch 03 · Question 2

A sample of 16 gives ȳ = 50, s = 8. SE(ȳ) = ?

Why: 8/√16 = 2.
Ch 03 · Question 3

A t-interval is [12, 20]. The sample mean and ME are…

Why: Midpoint 16, half-width 4.
Ch 03 · Question 4

Which sample is least suitable for a t-interval?

Why: Small n with an outlier breaks near-Normality.
Ch 03 · Question 5

The CLT says that for large n the distribution of ȳ is approximately…

Why: Regardless of the population shape.
Ch 03 · Question 6

Why use z* in the sample-size formula for a mean?

Why: df depends on n, which you are trying to find.
Ch 03 · Question 7

Compared with z*, t* at the same level is…

Why: t has heavier tails, so t* > z*.
Ch 03 · Question 8

Which does NOT narrow a t-interval?

Why: A larger s widens it.

Exam-style questions

Exam-style · Ch 03

A café logs the waiting time of 20 random customers: mean 4.8 min, SD 1.6 min, histogram unimodal without outliers. Build a 90% interval and say what sample size would halve its margin of error.

Show outline of a full answer
  1. Conditions: randomisation, 10%, nearly Normal.
  2. t*₁₉ at 90% ≈ 1.729; SE = 1.6/√20 ≈ 0.358; ME ≈ 0.62 → [4.18, 5.42].
  3. Interpretation in context (minutes).
  4. Halving ME needs ≈ 4× the sample: about 80 customers.

Central Limit Theorem simulatorInteractive

Pick a skewed population and watch the distribution of sample means turn Normal as n grows.

Mean interval and sample sizeInteractive

Summary statistics in, t-interval and planning sample size out.

t versus NormalInteractive

Compare t tails with the Normal curve for different degrees of freedom.