Confidence interval for a mean
A confidence interval for a mean is the sample mean plus or minus a margin of error: x-bar +/- t * s / sqrt(n), with t taken from the t distribution with n - 1 degrees of freedom. For 95% confidence and a large sample t is about 1.96.
Syntax
CI = x-bar +/- t(alpha/2, n-1) * s / sqrt(n)| Part | What it is |
|---|---|
x-bar | the sample mean |
s | the sample standard deviation |
n | the sample size |
t(alpha/2, n-1) | the critical t value; 2.064 for 95% with 24 degrees of freedom |
Examples
n = 25, x-bar = 50, s = 10, 95% confidence
SE = 10 / sqrt(25) = 2; t(0.025, 24) = 2.064
margin = 2.064 * 2 = 4.128Result: 45.87 to 54.13
Excel: =CONFIDENCE.T(0.05, 10, 25) returns the margin 4.128
Critical t in Excel
=T.INV.2T(0.05, 24)Result: 2.064
Known population sigma = 10, n = 25, x-bar = 50 (z interval)
margin = 1.96 * 2Result: 46.08 to 53.92
Excel: =CONFIDENCE.NORM(0.05, 10, 25)
Common mistakes
- Using z = 1.96 with a small sample and an estimated sd; use the t value, which is larger and widens the interval correctly.
- Multiplying by s instead of s / sqrt(n); the interval is about the mean, so it uses the standard error.
- Saying there is a 95% probability the true mean is in this interval; the correct statement is that 95% of intervals built this way contain the true mean.
Practice Confidence interval for a mean
These drills check your answer on live data, free, no account needed.
- Margin of error for a mean (t)A random sample of 8 minutes customers waited on hold: 19, 14, 11, 9, 10, 6, 11, 15. What is the margin of error of a 90% confidence interval for the population mean, using the t distribution? Round to 2 decimal places.
- Critical t value for an intervalYou will build a 90% confidence interval for a mean from a sample of 5 observations, with the population standard deviation unknown. What critical value t* should you use? Round to 3 decimal places.
Questions
When do I use t versus z for a confidence interval?
Use t when the population standard deviation is unknown and estimated by s, which is nearly always. Use z only when sigma is known. For n above about 100 the two give almost the same answer.
How do I make the interval narrower?
Collect more data (the width shrinks with sqrt(n)), accept a lower confidence level, or reduce measurement variability.
What does CONFIDENCE.T return in Excel?
Only the margin of error. Add and subtract it from the sample mean yourself to get the interval.
Related
- Margin of errorMargin of error is the critical value times the standard error: z times sqrt(p(1 - p) / n) for a proportion, t times s over root n for a mean. Poll examples.
- Standard errorThe standard error of the mean is s / sqrt(n); for a proportion it is sqrt(p(1 - p) / n). Worked examples, SE versus standard deviation and the Excel formula.
- One-sample t-testHow to run a one-sample t-test: compute t = (x-bar - mu0) / (s / sqrt(n)), find the p-value with n - 1 degrees of freedom and decide. Example and Excel.
- Sample sizeSample size formulas n = (z sigma / E)^2 for a mean and n = z^2 p(1 - p) / E^2 for a proportion, worked examples giving 97 and 385, and rounding rules.
Previous: Standard errorNext: Confidence interval for a proportion