A t-test 95% confidence interval is a range of plausible values for a population parameter, calculated from sample data using the t-distribution. For a mean, it is usually the sample mean plus or minus a critical t-value multiplied by the standard error; under the corresponding two-sided test, the interval contains exactly the parameter values that would not be rejected at the 5% significance level.
What a 95% t confidence interval means
A confidence interval describes the uncertainty in an estimate. In repeated sampling, if researchers built intervals in the same way from many comparable samples, about 95% of those intervals would contain the true population mean, assuming the model and sampling conditions are appropriate. The 95% refers to the long-run performance of the method; it does not mean there is a 95% probability that the fixed population mean lies inside this particular interval.
For example, suppose a sample produces a 95% interval for a mean difference of 2 to 8 units. The data are compatible with differences in that range under the method’s assumptions. Because zero is not included, the corresponding two-sided test of a zero difference would reject the null hypothesis at the 0.05 level. That does not establish that the difference is practically important or that the treatment caused it.
Formula for a t interval
For one sample of independent observations, a two-sided confidence interval for the population mean is:
x̄ ± t* × s/√n
x̄is the sample mean.sis the sample standard deviation.nis the sample size, ands/√nis the estimated standard error of the mean.t*is the critical value from the t-distribution withn − 1degrees of freedom for the chosen confidence level.
The quantity t* × s/√n is the margin of error. A t critical value is used because the population standard deviation is generally unknown and must be estimated from the sample. The t-distribution has heavier tails than the standard normal distribution, especially with small samples, reflecting the extra uncertainty from estimating that standard deviation.
Worked example
Imagine 25 independent measurements have a mean of 50 and a sample standard deviation of 10. The standard error is 10/√25 = 2. For a two-sided 95% interval with 24 degrees of freedom, the critical t-value is about 2.064. The interval is therefore 50 ± (2.064 × 2), or approximately 45.9 to 54.1.
This interval estimates the population mean, not the range in which 95% of individual measurements fall. A prediction interval for a new observation is wider because it includes both uncertainty about the mean and variation among individual observations.
How to calculate it and choose the right test
First identify the quantity you want to estimate. Then choose the t procedure that matches how the observations were collected:
- One-sample t interval: estimates one population mean from one sample.
- Paired t interval: estimates the mean of within-pair differences, such as before-and-after measurements on the same people. Calculate each pair’s difference, then apply the one-sample formula to those differences.
- Two-sample t interval: estimates the difference between two independent population means. Welch’s method is a common choice because it does not assume equal population variances; its standard error and degrees of freedom differ from the one-sample formula.
For a two-sample comparison, software should report which method it uses. Do not treat paired data as independent samples: doing so discards the pairing and can produce an inappropriate standard error. Likewise, a confidence interval for a mean is not automatically an interval for a median, proportion, or individual value.
Assumptions and common problems
A t interval is not guaranteed to be reliable simply because a calculator produces a result. Check that observations are sampled or assigned in a way that supports the intended inference, and that observations are independent within the chosen design. For a paired analysis, the independent units are the pairs, and the differences are the values analyzed.
With a small sample, the data—or paired differences—should be reasonably consistent with a normal distribution and should not contain severe outliers. With larger samples, the sample mean is often more robust to moderate departures from normality, but strong skew, extreme outliers, dependence, or a biased sample can still undermine the result. The t method does not repair poor sampling or confounding.
- Use the correct standard error and degrees of freedom for the design.
- Do not use a one-sided interval just because the observed result points in a convenient direction; the direction should be justified in advance.
- Report the estimate, interval, sample size, and method, not only whether the interval excludes zero.
- If many outcomes or comparisons are tested, consider that ordinary 95% intervals do not automatically account for multiple testing.
Relationship to a t-test and other intervals
A two-sided t-test at significance level 0.05 and a two-sided 95% t confidence interval are mathematically linked when they use the same model, data, and variance assumptions. For a test of a mean equal to a specified value, the test rejects that value exactly when it lies outside the corresponding 95% interval. For a test of a difference equal to zero, the same rule applies to the interval for the difference.
This link does not mean a confidence interval is merely a significance test in disguise. It also shows the direction and range of estimates compatible with the data, making it easier to assess precision and practical relevance. A narrow interval indicates more precision than a wide one, though neither alone establishes whether an effect matters in context.
Use a z interval when the population standard deviation is known and the model’s conditions support it; in ordinary applied work it is usually unknown, so t methods are common. For proportions, counts, or strongly non-normal data, methods designed for those outcomes may be more suitable than a t interval for a mean.
Frequently Asked Questions
What is the formula for a 95% t confidence interval?
For one sample, it is x̄ ± t* × s/√n, where t* uses n − 1 degrees of freedom for a two-sided 95% interval. Other designs, including paired and independent two-sample comparisons, use their corresponding standard errors and degrees of freedom.
Does a 95% confidence interval mean there is a 95% chance the true mean is inside?
Not in the standard frequentist interpretation. The population mean is treated as fixed; 95% describes the proportion of intervals that would capture it over repeated samples under the method’s assumptions.
If a 95% interval includes zero, is the result significant?
For a matching two-sided test of a zero effect at the 0.05 level, an interval that includes zero corresponds to failing to reject that null hypothesis. This is not proof that the effect is zero; the interval may include both negligible and important effects.
Why use a t interval instead of a z interval?
Because the population standard deviation is usually unknown and is estimated by the sample standard deviation. The t-distribution accounts for the added uncertainty, particularly when the sample is small.
Does a 95% confidence interval contain 95% of the observations?
No. It estimates a population parameter, commonly a mean. To describe the spread of individual values, use a measure such as a standard deviation or an appropriate prediction interval.
