Statistics

Confidence Intervals for Means

Last updated: March 2026 · Advanced
Before you start

You should be comfortable with:

Real-world applications
πŸ’Š
Nursing

Medication dosages, IV drip rates, vital monitoring

When you want to estimate a population mean μ\mu from a sample, a single number like xˉ=105\bar{x} = 105 tells you surprisingly little. Is the true mean likely to be 100? Or 110? Or somewhere else entirely? A confidence interval for the mean answers this question by providing a range of plausible values for μ\mu, together with a stated level of confidence. In this lesson, you will learn two approaches: the z-interval (when the population standard deviation is known) and the t-interval (when it is not).

Z-Interval (Population Standard Deviation Known)

When the population standard deviation Οƒ\sigma is known β€” which is rare in practice but foundational for understanding the concept β€” the confidence interval for the mean is:

xΛ‰Β±zβˆ—β‹…Οƒn\bar{x} \pm z^* \cdot \frac{\sigma}{\sqrt{n}}

Here xΛ‰\bar{x} is the sample mean, Οƒ\sigma is the known population standard deviation, nn is the sample size, and zβˆ—z^* is the critical value from the standard normal distribution for your chosen confidence level (1.645 for 90%, 1.960 for 95%, 2.576 for 99%).

The quantity σn\frac{\sigma}{\sqrt{n}} is the standard error of the mean — it measures how much the sample mean xˉ\bar{x} typically varies from sample to sample. Notice that as nn increases, the standard error decreases: larger samples produce more precise estimates.

Example 1: IQ Scores

IQ tests are designed so that Οƒ=15\sigma = 15 (this is known by the test’s construction). A researcher administers the test to a random sample of n=50n = 50 college students and finds xΛ‰=105\bar{x} = 105. Construct a 95% confidence interval for the mean IQ of all college students.

Step 1: Calculate the standard error.

SE=Οƒn=1550=157.071=2.121SE = \frac{\sigma}{\sqrt{n}} = \frac{15}{\sqrt{50}} = \frac{15}{7.071} = 2.121

Step 2: Calculate the margin of error.

ME=zβˆ—Γ—SE=1.960Γ—2.121=4.157ME = z^* \times SE = 1.960 \times 2.121 = 4.157

Step 3: Construct the interval.

105Β±4.16=(100.84,Β 109.16)105 \pm 4.16 = (100.84,\ 109.16)

Answer: We are 95% confident that the mean IQ of all college students is between 100.84 and 109.16.

The T-Distribution

In the real world, you almost never know Οƒ\sigma. When you replace Οƒ\sigma with the sample standard deviation ss, you introduce additional uncertainty β€” your estimate of the spread itself has sampling variability. The t-distribution accounts for this extra uncertainty.

The t-distribution looks like the standard normal distribution (symmetric, bell-shaped, centered at 0) but with heavier tails. This means extreme values are more likely under the t-distribution than under the normal, which makes the confidence interval appropriately wider when you are less certain about the spread.

The t-distribution has one parameter: degrees of freedom (df), which equals nβˆ’1n - 1 for a one-sample interval. Key properties include:

  • When df is small (say 5 or 10), the tails are noticeably heavier than the normal curve
  • As df increases, the t-distribution gets closer and closer to the standard normal
  • For df of 30 or more, the t-distribution and the normal distribution are nearly identical
  • At df=∞df = \infty, the t-distribution is exactly the standard normal

This means the t-distribution automatically adjusts: small samples get wider intervals (more uncertainty), while large samples get intervals similar to the z-interval.

T-Interval (Population Standard Deviation Unknown)

The t-interval is the standard approach for constructing confidence intervals for means in practice:

xΛ‰Β±tβˆ—β‹…sn\bar{x} \pm t^* \cdot \frac{s}{\sqrt{n}}

The formula looks just like the z-interval, with two changes: Οƒ\sigma is replaced by ss (the sample standard deviation), and zβˆ—z^* is replaced by tβˆ—t^* (the critical value from the t-distribution with df=nβˆ’1df = n - 1).

Example 2: Patient Recovery Time

A hospital records the recovery time (in days) for n=25n = 25 randomly selected patients who underwent a particular surgery. The sample mean is xˉ=4.8\bar{x} = 4.8 days and the sample standard deviation is s=1.2s = 1.2 days. Construct a 95% confidence interval for the true mean recovery time.

Step 1: Determine degrees of freedom and the critical value.

df=25βˆ’1=24df = 25 - 1 = 24

From a t-table at 95% confidence with df=24df = 24: tβˆ—=2.064t^* = 2.064.

Step 2: Calculate the standard error.

SE=sn=1.225=1.25=0.24SE = \frac{s}{\sqrt{n}} = \frac{1.2}{\sqrt{25}} = \frac{1.2}{5} = 0.24

Step 3: Calculate the margin of error.

ME=tβˆ—Γ—SE=2.064Γ—0.24=0.495ME = t^* \times SE = 2.064 \times 0.24 = 0.495

Step 4: Construct the interval.

4.8Β±0.50=(4.30,Β 5.30)4.8 \pm 0.50 = (4.30,\ 5.30)

Answer: We are 95% confident that the true mean recovery time is between 4.30 and 5.30 days. A hospital administrator could use this interval to plan staffing and bed availability.

Common tβˆ—t^* Values

This table provides critical values for the most commonly used confidence levels and degrees of freedom. For degrees of freedom not listed, use the nearest smaller df (this gives a slightly wider, more conservative interval).

df90%95%99%
101.8122.2283.169
151.7532.1312.947
201.7252.0862.845
241.7112.0642.797
301.6972.0422.750
601.6712.0002.660
1201.6581.9802.617
∞\infty1.6451.9602.576

Notice the bottom row: as degrees of freedom approach infinity, tβˆ—t^* converges to zβˆ—z^*. This confirms that the t-distribution becomes the standard normal for large samples.

Conditions for a Valid T-Interval

Before using the t-interval, verify these conditions:

  1. Random sample β€” the data must come from a random sampling process
  2. Independence β€” observations must be independent (the 10% condition: sample size is less than 10% of the population)
  3. Normality — the population should be approximately normally distributed, or the sample size should be at least 30 (at which point the Central Limit Theorem ensures the sampling distribution of xˉ\bar{x} is approximately normal regardless of the population shape)
  4. No strong outliers β€” for small samples, the t-interval is sensitive to outliers. A boxplot or dotplot can help check for extreme values.

For small samples from clearly non-normal populations (heavily skewed distributions with outliers), consider using a nonparametric method like the bootstrap confidence interval instead.

Z vs T β€” Which Should You Use?

SituationUseWhy
Οƒ\sigma knownz-intervalYou know the exact population spread
Οƒ\sigma unknown, nβ‰₯30n \geq 30t-interval (z is similar)t accounts for estimating Οƒ\sigma with ss
Οƒ\sigma unknown, nn smaller than 30t-intervalMust use t; the extra tail weight matters

When in doubt, use the t-interval. It is always valid (even when Οƒ\sigma is known, the t-interval works β€” it is just very slightly wider than necessary). The z-interval is really just a special case of the t-interval where df is infinite.

Choosing Sample Size for a Desired Margin of Error

Just as with proportions, researchers often plan studies by specifying the desired margin of error and then determining how large a sample is needed. For means, the sample size formula is:

n=(zβˆ—β‹…ΟƒE)2n = \left(\frac{z^* \cdot \sigma}{E}\right)^2

This formula uses zβˆ—z^* (not tβˆ—t^*) because at the planning stage, you do not yet know the sample size, and therefore you do not know the degrees of freedom. The z-approximation is standard for sample size planning.

You also need a preliminary estimate of Οƒ\sigma, which typically comes from prior studies, pilot data, or published literature.

Example 3: Blood Pressure Study

A researcher wants to estimate the mean systolic blood pressure of adults in a community with a margin of error of no more than 2 mmHg at 95% confidence. Prior studies suggest Οƒβ‰ˆ12\sigma \approx 12 mmHg. How many participants are needed?

n=(1.96Γ—122)2=(23.522)2=(11.76)2=138.3n = \left(\frac{1.96 \times 12}{2}\right)^2 = \left(\frac{23.52}{2}\right)^2 = (11.76)^2 = 138.3

Round up: n=139n = 139.

Answer: The researcher needs at least 139 participants. If the preliminary estimate of Οƒ\sigma turns out to be too low, the actual margin of error will be larger than 2 mmHg β€” so researchers sometimes add a buffer by rounding up more generously.

Real-World Application: Nursing β€” Estimating Average Wait Time

An emergency department manager wants to estimate the average patient wait time before triage. She randomly selects n=36n = 36 patients over a two-week period and records their wait times in minutes. The results show xˉ=22.5\bar{x} = 22.5 minutes and s=8.4s = 8.4 minutes.

Construct a 95% confidence interval for the true mean wait time.

With df=36βˆ’1=35df = 36 - 1 = 35, the critical value is approximately tβˆ—=2.030t^* = 2.030.

SE=8.436=8.46=1.40SE = \frac{8.4}{\sqrt{36}} = \frac{8.4}{6} = 1.40

ME=2.030Γ—1.40=2.842ME = 2.030 \times 1.40 = 2.842

CI:22.5Β±2.84=(19.66,Β 25.34)CI: 22.5 \pm 2.84 = (19.66,\ 25.34)

Interpretation: The hospital is 95% confident that the true mean wait time before triage is between 19.7 and 25.3 minutes. If the department’s target is 20 minutes or less, this interval suggests the target may not be met β€” the lower bound is barely below 20, and the best estimate is 22.5. This data provides actionable evidence for staffing decisions.

Why the t-interval is appropriate here: The population standard deviation of wait times is unknown (we estimated it with s=8.4s = 8.4), and the sample size of 36 satisfies the Central Limit Theorem requirement even if wait times are somewhat right-skewed (as they often are in healthcare settings).

Practice Problems

Test your understanding with these problems. Click to reveal each answer.

Problem 1: A random sample of 40 packages from an assembly line has a mean weight of xˉ=16.2\bar{x} = 16.2 ounces and s=0.8s = 0.8 ounces. Construct a 95% confidence interval for the true mean weight.

With df=39df = 39, use tβˆ—β‰ˆ2.023t^* \approx 2.023.

SE=0.840=0.86.325=0.1265SE = \frac{0.8}{\sqrt{40}} = \frac{0.8}{6.325} = 0.1265

ME=2.023Γ—0.1265=0.2559ME = 2.023 \times 0.1265 = 0.2559

CI:16.2Β±0.26=(15.94,Β 16.46)CI: 16.2 \pm 0.26 = (15.94,\ 16.46)

Answer: We are 95% confident that the true mean package weight is between 15.94 and 16.46 ounces.

Problem 2: A sample of 10 ceramic tiles has a mean breaking strength of xΛ‰=400\bar{x} = 400 psi and s=25s = 25 psi. Construct a 99% confidence interval for the mean breaking strength. (Use tβˆ—=3.250t^* = 3.250 for df = 9 at 99%.)

SE=2510=253.162=7.906SE = \frac{25}{\sqrt{10}} = \frac{25}{3.162} = 7.906

ME=3.250Γ—7.906=25.69ME = 3.250 \times 7.906 = 25.69

CI:400Β±25.7=(374.3,Β 425.7)CI: 400 \pm 25.7 = (374.3,\ 425.7)

Answer: We are 99% confident that the mean breaking strength is between 374.3 and 425.7 psi. Notice how wide this interval is β€” with only 10 observations and 99% confidence, there is substantial uncertainty.

Problem 3: A researcher collects IQ scores from n=64n = 64 participants (σ=15\sigma = 15 is known). The sample mean is xˉ=102\bar{x} = 102. Construct a 90% confidence interval. Should you use z or t?

Since Οƒ\sigma is known, use the z-interval with zβˆ—=1.645z^* = 1.645.

SE=1564=158=1.875SE = \frac{15}{\sqrt{64}} = \frac{15}{8} = 1.875

ME=1.645Γ—1.875=3.084ME = 1.645 \times 1.875 = 3.084

CI:102Β±3.08=(98.92,Β 105.08)CI: 102 \pm 3.08 = (98.92,\ 105.08)

Answer: We are 90% confident that the mean IQ is between 98.92 and 105.08.

Problem 4: You want to estimate the mean commute time in a city with a margin of error of 3 minutes at 95% confidence. A pilot study suggests Οƒβ‰ˆ18\sigma \approx 18 minutes. What sample size is needed?

n=(zβˆ—Γ—ΟƒE)2=(1.96Γ—183)2=(35.283)2=(11.76)2=138.3n = \left(\frac{z^* \times \sigma}{E}\right)^2 = \left(\frac{1.96 \times 18}{3}\right)^2 = \left(\frac{35.28}{3}\right)^2 = (11.76)^2 = 138.3

Round up: n=139n = 139.

Answer: You need at least 139 participants.

Problem 5: A nurse samples 20 patients and records their resting heart rates: xΛ‰=74\bar{x} = 74 bpm, s=6s = 6 bpm. Construct a 95% confidence interval. (Use tβˆ—=2.093t^* = 2.093 for df = 19 at 95%.)

SE=620=64.472=1.342SE = \frac{6}{\sqrt{20}} = \frac{6}{4.472} = 1.342

ME=2.093Γ—1.342=2.809ME = 2.093 \times 1.342 = 2.809

CI:74Β±2.81=(71.19,Β 76.81)CI: 74 \pm 2.81 = (71.19,\ 76.81)

Answer: We are 95% confident that the true mean resting heart rate is between 71.19 and 76.81 bpm. This range is within the normal resting heart rate of 60 to 100 bpm, consistent with healthy patients.

Key Takeaways

  • When Οƒ\sigma is known (rare), use the z-interval: xΛ‰Β±zβˆ—β‹…Οƒn\bar{x} \pm z^* \cdot \frac{\sigma}{\sqrt{n}}
  • When Οƒ\sigma is unknown (almost always), use the t-interval: xΛ‰Β±tβˆ—β‹…sn\bar{x} \pm t^* \cdot \frac{s}{\sqrt{n}} with df=nβˆ’1df = n - 1
  • The t-distribution has heavier tails than the normal, producing wider intervals that account for the uncertainty in estimating Οƒ\sigma with ss
  • As the sample size grows, the t-distribution approaches the normal distribution β€” for dfβ‰₯30df \geq 30, the difference is small
  • Conditions for the t-interval: random sample, independence (10% rule), approximate normality or nβ‰₯30n \geq 30, and no strong outliers for small samples
  • When in doubt, use the t-interval β€” it is always valid and only slightly more conservative than the z-interval
  • To plan a study with a desired margin of error, use n=(zβˆ—β‹…Οƒ/E)2n = (z^* \cdot \sigma / E)^2 and round up
  • In healthcare, confidence intervals for means help administrators quantify metrics like average wait times, recovery durations, and dosage responses β€” turning sample data into actionable estimates with clearly stated precision

Return to Statistics for more topics in this section.

Last updated: March 29, 2026