What a Confidence Interval for a Conditional Mean Describes
A regression model can estimate the mean outcome for cases with a particular set of predictor values. For example, it can estimate the mean test score for students with a specified baseline score and age, or the mean crop yield at a specified irrigation level. That estimated mean is not the outcome for any one individual at that profile. Individual outcomes can vary around the conditional mean.
A confidence interval describes uncertainty in the estimated conditional mean. It uses the fitted mean as its centre and extends in both directions by a margin based on the fitted mean’s standard error and a critical value. The interval is expressed in the outcome’s units, and its interpretation must name the predictor profile to which it applies.
Model, Assumptions, and the Interval Formula
For the standard t-based interval, write the regression model for the \(n\) observed outcomes as \(\mathbf{Y}=\mathbf{X}\boldsymbol{\beta}+\boldsymbol{\varepsilon}\), where \(\mathbf{X}\) contains the predictor values and the model’s columns, and \(\boldsymbol{\beta}\) is the vector of coefficients. Assume the mean function is correctly specified, the columns of \(\mathbf{X}\) are linearly independent, and, conditional on the predictors, the errors are independent with mean zero and common variance \(\sigma^2\). For an exact t interval, also assume the errors are normally distributed. In this setting, the predictor values are treated as fixed for the inference.
Let \(p\) be the number of estimated coefficients, including an intercept if the model has one. The residual degrees of freedom are \(n-p\). Estimate \(\sigma\) with the residual standard error \(s\), calculated from the residual sum of squares divided by \(n-p\). At profile \(\mathbf{x}_0\), the fitted mean’s standard error is \(SE(\hat{y}_0)=s\sqrt{\mathbf{x}_0^\mathsf{T}(\mathbf{X}^\mathsf{T}\mathbf{X})^{-1}\mathbf{x}_0}\). This is uncertainty in the estimated mean, not the standard deviation of individual outcomes at that profile.
The t critical value accounts for estimating the error variance from the regression residuals. The confidence level determines \(\alpha\): for a 95% interval, \(\alpha=0.05\), so the required quantile is \(t_{0.975,\ n-p}\). The degrees of freedom depend on the number of fitted coefficients, not just on the number of predictors named in a verbal description.
Why the t Interval Has This Form
For a fixed profile, \(\hat{y}_0\) is a linear combination of the estimated regression coefficients. Under the model assumptions, it is normally distributed around the true conditional mean \(\mathbf{x}_0^\mathsf{T}\boldsymbol{\beta}\). Its variance is \(\sigma^2\mathbf{x}_0^\mathsf{T}(\mathbf{X}^\mathsf{T}\mathbf{X})^{-1}\mathbf{x}_0\), so its standard deviation is the standard error formula with \(\sigma\) in place of \(s\).
When \(\sigma\) is unknown, it is estimated by \(s\). Under the normal-error model, the standardized estimate using \(s\) has a t distribution with \(n-p\) degrees of freedom. In symbols,
The central \(1-\alpha\) portion of this t distribution lies between \(-t_{1-\alpha/2,\ n-p}\) and \(t_{1-\alpha/2,\ n-p}\). Therefore, the standardized quantity falls between these limits with probability \(1-\alpha\). Rearranging those inequalities to isolate the fixed conditional mean gives the stated interval. Repeated samples under the model assumptions produce intervals that contain that mean at the stated rate; after an interval is calculated, the parameter is not treated as randomly moving within it.
Worked Example: Mean Yield at a Specified Irrigation Level
Suppose a hypothetical simple regression uses \(n=20\) independent plots to relate crop yield in kilograms per plot to irrigation in millimetres. The fitted mean yield at 50 mm of irrigation is 42.6 kg per plot, and its standard error is 1.80 kg per plot. Construct a 95% confidence interval for the mean yield at 50 mm.
The model has an intercept and a slope, so \(p=2\) and \(df=n-p=20-2=18\). Suppose the hypothetical residual checks show no meaningful curvature or change in spread, and no severe departure from normality; the plots were sampled independently. These checks support, but cannot prove, the working model assumptions. The 50 mm profile is within the observed irrigation range.
For a 95% interval, \(t_{0.975,18}\approx 2.101\). The margin of error is
Thus the interval is
Rounded to one decimal place, the 95% confidence interval is 38.8 to 46.4 kg per plot. Under the model assumptions, this method captures the true mean yield for plots receiving 50 mm of irrigation in 95% of repeated samples constructed in the same way. It does not say that 95% of individual plots at 50 mm will yield between these endpoints.
Worked Intervals at Different Predictor Profiles
Worked Example: Adjusted Mean Test Score in Multiple Regression
Consider a hypothetical model relating a student’s final test score, in points, to treatment group, baseline score, and age. There are 40 independent students and four fitted coefficients: an intercept, a treatment indicator coefficient, a baseline-score coefficient, and an age coefficient. At the profile “treatment group, baseline score 60 points, age 40 years,” the fitted conditional mean is 68.4 points and its standard error is 2.50 points. Find a 95% interval.
Assume the model’s mean form is appropriate and that hypothetical residual checks find no strong pattern in the residuals, no marked variance change, and no severe non-normality. The study records each student once, supporting independence. The profile is a combination represented by the data, so the estimate is not being made for a clearly unsupported combination of predictor values.
There are \(p=4\) coefficients, so \(df=40-4=36\). Using \(t_{0.975,36}\approx2.028\), the margin is
The interval is
The 95% confidence interval is approximately 63.3 to 73.5 test-score points for the model’s mean outcome at the stated treatment, baseline-score, and age profile. These are adjusted conditional means in the specified model; this interval alone does not establish that treatment caused a difference.
Worked Example: A 90% Interval for a Two-Level Factor
In a hypothetical study, a two-level factor indicates whether a participant received program A or program B. The outcome is recovery time in days. For 25 independent participants, the fitted mean recovery time for program A is 7.20 days, with standard error 0.600 days. Construct a 90% confidence interval for that group’s conditional mean.
The model includes an intercept and a program indicator, so \(p=2\) and \(df=25-2=23\). Assume the factor model is appropriate and the hypothetical residual checks do not reveal a serious violation of constant variance or normality; participant outcomes are independent. The group label “program A” defines the profile, and the outcome is measured in days.
For a 90% interval, \(\alpha=0.10\), so \(t_{0.95,23}\approx1.714\). The margin is
Therefore,
The 90% confidence interval is approximately 6.17 to 8.23 days for the mean recovery time under program A in this model. The confidence level is 90%, not 95%; using a 95% critical value would produce a different, wider interval.
Interpretation and Common Pitfalls
A complete report identifies the confidence level, the predictor profile, and the outcome units. For example: “The 95% confidence interval for the mean yield at 50 mm of irrigation is 38.8 to 46.4 kg per plot.” The interval concerns a model-based mean for cases at that profile. It does not describe the range of likely individual yields.
Do not confuse this interval with a prediction interval for a future individual outcome. A prediction interval must account both for uncertainty in the estimated mean and for individual variation around that mean, so its purpose and calculation differ. Here, the target is only the conditional mean. Also avoid interpreting a 95% interval as having a 95% probability of containing the fixed mean after it has been computed. The 95% statement refers to the long-run performance of the interval procedure under the model assumptions.
- Wrong: “The endpoints are the likely range for 95% of individual outcomes.” Correction: They estimate uncertainty about the mean outcome at the named profile.
- Wrong: “There is a 95% probability that the true mean lies in this particular interval.” Correction: The procedure has 95% coverage over repeated samples under its assumptions.
- Wrong: “Use the normal critical value for every regression interval.” Correction: In the usual model with unknown error variance, use a t critical value with \(n-p\) degrees of freedom.
- Wrong: “The interval applies to the outcome generally.” Correction: State the predictor profile and use the outcome’s units.
Before reporting an interval, verify the model and its assumptions, identify the complete profile, use the standard error for the fitted mean at that profile, and match the critical value to both the confidence level and residual degrees of freedom. These checks make the resulting range interpretable rather than merely a pair of numbers.
Check Your Understanding
Use the definitions and examples above to answer these questions.
- A model has 32 observations and estimates five coefficients. What are its residual degrees of freedom?
- A fitted mean is 15.0 units, its standard error is 1.2 units, and the appropriate critical value is 2.10. Calculate the confidence interval.
- In words, what does a 95% confidence interval for the conditional mean at a specified profile estimate?
- Why is the standard error of a fitted mean not the same as the standard deviation of individual outcomes at that profile?
- Why does a t-based interval use a critical value with \(n-p\) degrees of freedom?