Why the Profile Matters
A regression prediction is always tied to particular predictor values. If a model includes a group indicator, predicting for the reference group is not the same as predicting for the other group. If it includes an interaction, the relationship between a quantitative predictor and the outcome may differ by group. To construct an individual-outcome prediction interval, first represent the requested profile correctly; then use that profile’s fitted value and prediction uncertainty.
This tutorial focuses on specified combinations of factor levels and quantitative predictor values. The goal is an interval for a new individual outcome at that profile, not an interval for the conditional mean. The interval accounts for both uncertainty in the fitted mean and the variation of individual outcomes around that mean.
Model, Profile, and Interval
Write a multiple linear regression model in design-row form as \(Y_i=\mathbf{x}_i^\mathsf{T}\boldsymbol{\beta}+\varepsilon_i\), where \(\mathbf{x}_i\) contains an intercept and the predictor terms for observation \(i\), and \(\boldsymbol{\beta}\) contains their coefficients. For a factor, the design row contains the indicator values specified by its coding. For an interaction, it also contains the product terms formed from the relevant predictor values.
The standard t-based prediction interval requires a correctly specified linear conditional mean for the profile of interest, independent errors with mean zero and common variance, and a new outcome independent of the data used to fit the model. Normal errors are assumed for the usual exact t calibration. The design matrix must have full column rank so the model coefficients can be estimated. These assumptions concern the model and the prediction procedure; a plausible-looking profile alone does not guarantee that they hold.
Let \(\hat{\boldsymbol{\beta}}\) be the fitted coefficient vector, \(s\) the residual standard error, and \(df\) the residual degrees of freedom. The point prediction at \(\mathbf{x}_0\) is \(\hat{y}_0=\mathbf{x}_0^\mathsf{T}\hat{\boldsymbol{\beta}}\). Define the profile’s leverage quantity as \(h_0=\mathbf{x}_0^\mathsf{T}(X^\mathsf{T}X)^{-1}\mathbf{x}_0\), where \(X\) is the design matrix used to fit the model. The prediction standard error includes both the uncertainty in estimating the mean and the variability of a new individual outcome.
Here \(t_{\alpha/2,df}\) is the positive critical value with upper-tail probability \(\alpha/2\) from a t distribution with \(df\) degrees of freedom. The square-root term is specific to predicting an individual outcome. In contrast, an interval for the conditional mean at that profile uses \(s\sqrt{h_0}\), without the added 1. The distinction is why a prediction interval is generally wider than a confidence interval for the mean at the same profile.
Why the Prediction Standard Error Has This Form
The structure of the formula follows by separating the two sources of prediction error. Under the model, a new outcome at the specified profile is \(Y_{\mathrm{new}}=\mathbf{x}_0^\mathsf{T}\boldsymbol{\beta}+\varepsilon_{\mathrm{new}}\). Subtract the fitted prediction:
The first term is the new individual’s deviation from the conditional mean. The second is the estimation error in the fitted mean. Under the stated assumptions, the new error is independent of the fitted coefficients, and the two terms have variances \(\sigma^2\) and \(\sigma^2h_0\), respectively. Therefore their variances add:
Replacing \(\sigma\) with the residual standard error \(s\) gives the estimated prediction standard error \(s\sqrt{1+h_0}\). The profile’s factor levels and quantitative values determine both \(\hat{y}_0\) and \(h_0\), so the interval must be calculated for the actual requested profile.
Worked Examples
Worked Example: A New Individual in a Treatment Group
Suppose a hypothetical study models a score using treatment group and age. Let \(A=0\) for the reference treatment and \(A=1\) for the new treatment. Let \(x\) be age in years minus 50, so the fitted model is \(\hat{y}=50+4A+0.6x\). For an individual in the new treatment group aged 60, suppose the model has \(s=5\) score points, \(df=24\), and \(h_0=0.08\). Calculate a 95% prediction interval. Assume the model and error conditions stated above are appropriate for this prediction.
At this profile, \(A=1\) and \(x=60-50=10\). Thus the fitted prediction is
Using \(t_{0.025,24}=2.064\), the prediction standard error and margin of error are
Therefore, the 95% prediction interval is
The interval estimates a range of plausible scores for one new individual aged 60 in the new treatment group, under this model. It is not an interval for the average score of all such individuals.
Worked Example: An Interaction Changes the Profile Prediction
Consider the hypothetical model \(\hat{y}=20+2.5x-3G+1.2xG\), where \(G=0\) denotes the reference group and \(G=1\) the comparison group, and \(x\) is dose in specified units. For a new individual in the comparison group at dose \(x=4\), suppose \(s=4\), \(df=30\), and \(h_0=0.10\). Find the 95% prediction interval. Assume the model and error conditions stated above are suitable.
The design row includes \(G=1\), \(x=4\), and the interaction value \(xG=4(1)=4\). The point prediction is
The interaction is included because the profile has both \(x=4\) and \(G=1\). Using \(t_{0.025,30}=2.042\), calculate
The interval is
This interval is for a new individual in the comparison group at dose 4, not for an individual in the reference group or at another dose. Omitting the interaction term would change the fitted prediction and would not represent the stated model at this profile.
Worked Example: Choosing the Correct Indicator for a Three-Level Factor
Suppose a hypothetical model predicts a measurement using a three-level factor with levels A, B, and C, where A is the reference level. Let \(B\) and \(C\) be indicator variables, and let \(x\) be a quantitative predictor. The fitted model is \(\hat{y}=40+1.5x+5B-2C+0.4xB+1.0xC\). For a new individual at level C with \(x=3\), suppose \(s=6\), \(df=40\), and \(h_0=0.06\). Calculate a 95% prediction interval, assuming the model and error conditions are suitable.
Level C corresponds to \(B=0\) and \(C=1\). At \(x=3\), the interaction terms are \(xB=3(0)=0\) and \(xC=3(1)=3\). Consequently,
Using \(t_{0.025,40}=2.021\), the prediction standard error and margin are
Thus the 95% prediction interval is
or approximately \((33.0,\ 58.0)\) measurement units. The endpoints refer to a single new individual at level C with \(x=3\). Using the indicator for level B instead would describe a different profile and produce a different prediction.
A Reliable Calculation Sequence
For a model with factors or interactions, it helps to separate the task into profile construction and interval calculation. That separation makes it easier to notice a wrong indicator or a missing product term before it affects the result.
Write down the exact factor levels and quantitative predictor values, including any centering or scaling used to define the model predictors.
Set the factor indicators according to the model’s coding and calculate every interaction as a product of its component predictor values.
Evaluate \(\mathbf{x}_0^\mathsf{T}\hat{\boldsymbol{\beta}}\) for the point prediction and obtain the corresponding \(h_0\) for that same design row.
Use the residual standard error, residual degrees of freedom, and t critical value in the individual-outcome formula. State the profile and outcome units in the interpretation.
Common Pitfall: Treating a Profile as a Mean
A frequent error is to use the confidence-interval standard error for a conditional mean when the question asks about an individual. The reasoning might be, “The prediction is at this profile, so I will use \(s\sqrt{h_0}\).” That omits the variation of a new individual outcome around its conditional mean. For an individual-outcome prediction interval, the correct factor is \(s\sqrt{1+h_0}\). The added 1 remains present even when the profile has very small leverage.
Another profile-specific mistake is to enter the right factor level but forget an interaction term. In the second example, a comparison-group individual at dose 4 has \(xG=4\), not 0. The indicator and interaction values must both match the requested profile. A correct formula applied to the wrong design row gives an interval for the wrong prediction target.
Check Your Understanding
For each question, pay attention to whether the requested target is an individual outcome or a conditional mean.
- In a model with reference-group indicator \(G=0\) and comparison-group indicator \(G=1\), what indicator value represents a new individual in the comparison group?
- A model includes the interaction \(xG\). What is the value of this term for a profile with \(x=5\) and \(G=1\)?
- Why does an individual-outcome prediction standard error include \(1+h_0\), whereas a conditional-mean standard error uses \(h_0\)?
- A model uses \(x=\text{age}-40\). What value of \(x\) should be used for a profile aged 55, and why must the model’s centering be respected?
- Suppose the fitted prediction is 12 units and the calculated prediction margin is 4 units. State the resulting interval and describe what it covers for a specified profile.