Why Build a Prediction Table?
A fitted regression model can produce a conditional mean for many combinations of predictor values. A table makes those combinations explicit: readers can see which profiles were evaluated, what mean the model estimates for each, and how precise each estimate is. This is especially useful when a model includes several predictors or factor levels, because a number without its profile can be difficult to interpret.
A prediction table is not just a list of model outputs. Its rows should answer a useful question, its labels should identify the profiles precisely, and its units should make the results interpretable. The intervals in this tutorial describe uncertainty about conditional means, not the range in which individual outcomes are expected to fall.
What Each Row Must Specify
A row represents one predictor profile: a complete set of predictor values at which the fitted mean is evaluated. A profile might specify a particular value of a quantitative predictor, a level of a categorical predictor, or values for several predictors together. Factor levels should be written as meaningful labels, not only as codes such as 0 and 1.
For an outcome \(Y\), write the regression model’s conditional mean at profile \(x\) as \(\mu(x)=E(Y\mid x)\). The model estimates this mean as \(\hat{\mu}(x)\). A confidence interval adds uncertainty about the estimated mean. In a standard regression model with estimated coefficient vector \(\hat{\beta}\), a profile corresponds to a design vector \(x\), and the fitted mean is \(x^\mathsf{T}\hat{\beta}\). Its standard error is calculated using the coefficient estimates’ covariance matrix. The earlier material on confidence intervals for conditional means develops that uncertainty calculation; here the emphasis is on selecting profiles and presenting the results consistently.
Before using a model to build a table, check the assumptions relevant to its estimates and intervals. The regression form should represent the conditional mean adequately for the profiles considered; observations should be independent under the study design; and the error assumptions used for the standard errors and confidence intervals should be reasonable. For exact small-sample \(t\)-based intervals, the usual model assumes normally distributed errors with mean zero and constant variance, conditional on the predictors. Also check that the requested profiles make scientific sense and are supported by the observed predictor values. A neat table cannot repair an unsuitable model or an unsupported extrapolation.
Worked Examples
Worked Example: Means Across a Quantitative Predictor
Suppose a hypothetical study models weekly exercise time, \(Y\), in minutes using a linear regression on age, \(x\), in years. The fitted model is \(\hat{\mu}(x)=30+1.2x\). The observed ages range from 20 to 60 years. Assume independent observations, a suitable linear conditional-mean form, and approximately normal errors with constant variance. The fitted model has \(df=30\), and its standard errors for the fitted means at ages 25, 40, and 55 are 4.0, 3.0, and 4.0 minutes. All three ages are within the observed range, so these are not extrapolated profiles.
For a two-sided 95% confidence interval, use \(t^*=t_{0.975,30}\approx2.042\). For each row, calculate \(\hat{\mu}(x)\pm t^*SE\).
At age 25, the fitted mean is \(30+1.2(25)=60\) minutes per week. The margin of error is \(2.042(4.0)=8.168\) minutes, giving \(60\pm8.168\), or 51.83 to 68.17 minutes per week.
At age 40, the fitted mean is \(30+1.2(40)=78\) minutes per week. The margin is \(2.042(3.0)=6.126\) minutes, so the interval is 71.87 to 84.13 minutes per week.
At age 55, the fitted mean is \(30+1.2(55)=96\) minutes per week. The margin is \(2.042(4.0)=8.168\) minutes, so the interval is 87.83 to 104.17 minutes per week.
| Age (years) | Fitted mean exercise time (minutes/week) | 95% CI for mean (minutes/week) |
|---|---|---|
| 25 | 60.00 | 51.83 to 68.17 |
| 40 | 78.00 | 71.87 to 84.13 |
| 55 | 96.00 | 87.83 to 104.17 |
Each interval estimates the mean weekly exercise time for people of the specified age under the model. It does not say that 95% of individual people at that age exercise within the listed limits. The table also states the predictor and outcome units directly, so its entries can be understood without decoding model notation.
Worked Example: Factor Levels and a Quantitative Interaction
Suppose a hypothetical model estimates a health score, measured in points, from treatment group and baseline score. The model allows the association between baseline score and mean follow-up score to differ by treatment group. The intended comparison is between the labelled groups “Standard care” and “New program” at baseline scores of 40 and 60 points. These values are within the observed baseline-score range. Assume independent observations and that the fitted interaction model and error assumptions are adequate; the model has \(df=40\). Its fitted means and standard errors are provided by the model calculations below.
At baseline score 40, the fitted mean is 65 points for Standard care and 70 points for the New program. At baseline score 60, the fitted mean is 75 points for Standard care and 74 points for the New program. The standard errors for these four fitted means, in the same order, are 1.5, 1.7, 1.6, and 1.8 points. With \(t^*=t_{0.975,40}\approx2.021\), calculate each interval as fitted mean \(\pm 2.021\) times its standard error.
For Standard care at baseline 40, \(65\pm2.021(1.5)=65\pm3.0315\), giving 61.97 to 68.03 points. For the New program at baseline 40, \(70\pm2.021(1.7)=70\pm3.4357\), giving 66.56 to 73.44 points.
For Standard care at baseline 60, \(75\pm2.021(1.6)=75\pm3.2336\), giving 71.77 to 78.23 points. For the New program at baseline 60, \(74\pm2.021(1.8)=74\pm3.6378\), giving 70.36 to 77.64 points.
| Treatment group | Baseline score (points) | Fitted mean follow-up score (points) | 95% CI for mean (points) |
|---|---|---|---|
| Standard care | 40 | 65.00 | 61.97 to 68.03 |
| New program | 40 | 70.00 | 66.56 to 73.44 |
| Standard care | 60 | 75.00 | 71.77 to 78.23 |
| New program | 60 | 74.00 | 70.36 to 77.64 |
The equal-baseline rows make the intended group comparisons visible, while retaining the full factor labels prevents ambiguity about which group each estimate represents. These are intervals for four separate means. They do not provide a confidence interval for the difference between groups; estimating uncertainty in a difference requires the standard error of that difference, which accounts for the covariance between fitted means.
A Justification for the Interval Entries
A confidence interval belongs to a particular profile. In a linear regression model, the fitted mean at that profile is a linear combination of the estimated coefficients. If the profile’s design vector is \(x\), then
Under the usual regression assumptions for a \(t\)-based interval, the estimate minus the true conditional mean, divided by its estimated standard error, follows a \(t\) distribution with the model’s residual degrees of freedom. Thus a two-sided 95% interval has the form
The profile matters twice: it determines the fitted mean and it determines the standard error. The critical value also depends on the confidence level and degrees of freedom. Therefore, one should not copy a single interval width across rows unless the model calculations actually give the same standard error for those profiles.
Worked Example: A Table From a Quadratic Mean Model
Suppose a hypothetical regression models a test score, in points, as a quadratic function of practice time, \(x\), in hours. The fitted conditional mean is \(\hat{\mu}(x)=60+3.2x-0.32x^2\). The observed practice-time range is 0 to 5 hours, and the table will show means at 0, 2.5, and 5 hours. Assume independent observations, a suitable quadratic mean form, and approximately normal errors with constant variance. The model has \(df=20\). Its standard errors at the three profiles are 2.5, 1.8, and 2.2 points.
For a two-sided 95% interval, \(t^*=t_{0.975,20}\approx2.086\). At 0 hours, \(\hat{\mu}(0)=60+3.2(0)-0.32(0)^2=60\). The margin is \(2.086(2.5)=5.215\), so the interval is 54.79 to 65.21 points.
At 2.5 hours, \(\hat{\mu}(2.5)=60+3.2(2.5)-0.32(2.5)^2=60+8-2=66\) points. The margin is \(2.086(1.8)=3.7548\), giving 62.25 to 69.75 points.
At 5 hours, \(\hat{\mu}(5)=60+3.2(5)-0.32(5)^2=60+16-8=68\) points. The margin is \(2.086(2.2)=4.5892\), giving 63.41 to 72.59 points. Each profile falls inside the observed range, and the table reports score means and intervals in points.
| Practice time (hours) | Fitted mean score (points) | Standard error (points) | 95% CI for mean score (points) |
|---|---|---|---|
| 0.0 | 60.00 | 2.50 | 54.79 to 65.21 |
| 2.5 | 66.00 | 1.80 | 62.25 to 69.75 |
| 5.0 | 68.00 | 2.20 | 63.41 to 72.59 |
The fitted means need not change at a constant rate across the rows: the quadratic model allows curvature. The interval widths also differ because their standard errors differ. Including the standard-error column is optional, but it can help a reader see why the reported limits vary.
Choosing Profiles and Labels Carefully
A useful table is designed around a question rather than an arbitrary grid of predictor values. For example, if the aim is to compare groups at a common covariate profile, include that same covariate value for each group. If the aim is to describe how a fitted mean changes over a quantitative predictor, select a small set of values that are interpretable and cover a relevant part of the observed range. The earlier material on adjusted group means and averaged marginal means distinguishes those targets; do not label a conditional mean at one profile as though it were an average over a population.
Use enough digits to avoid misleading rounding, but do not imply more precision than the model supports. Keep outcome units in the column headings, write predictor units next to their labels, and make interval endpoints unambiguous. When an outcome has been transformed, the scale of the reported values must be stated clearly; a transformed-scale mean and a mean returned to the original scale are not automatically interchangeable.
A confidence interval for a conditional mean expresses the uncertainty in estimating the model’s mean at a particular profile. It is not an interval for an individual future response. The distinction matters because individual outcomes vary around the conditional mean, in addition to the uncertainty in estimating that mean.
Common Mistake: Treating Separate Intervals as a Comparison
Wrong reasoning: “The group intervals overlap, so the group means are not different,” or “the intervals do not overlap, so the difference must be significant.” Separate confidence intervals describe uncertainty in each mean, not directly in their difference. Their overlap alone is not a general test of a difference.
Correction: Define the comparison of interest, such as the New program mean minus the Standard care mean at baseline score 40. Calculate that difference and its standard error using the covariance between the two fitted means, then form an interval or test for the difference. Report separate mean intervals if they are useful, but do not treat them as a substitute for uncertainty in the contrast.
A related presentation error is to list a fitted value without its predictor profile. “The predicted score is 66” is incomplete if the reader cannot tell which practice time, group, or other covariate values produced it. A prediction table should make that information part of the row, not leave it to be inferred.
Check Your Understanding
Answer these questions using the ideas in the tutorial.
- A table reports a fitted mean outcome of 18.4. What additional information about the predictor profile and units should accompany that value?
- Why might two rows comparing factor levels use exactly the same quantitative covariate values?
- A 95% confidence interval is reported for a conditional mean. Does it describe where 95% of individual outcomes at that profile will fall? Explain.
- For a profile with fitted mean 42 points, standard error 2 points, and critical value 2.1, calculate the 95% interval.
- Why can’t the overlap of two separate confidence intervals generally replace an interval for the difference between the two means?