Why Put Uncertainty on an Effect Plot?
A plotted conditional slope or fitted mean is an estimate, not a known quantity. Its value depends on estimated regression coefficients, which vary across samples. Adding confidence intervals to a plot makes that estimation uncertainty visible at selected values of a moderator or predictor profile.
The key qualification is pointwise. A 95% pointwise confidence interval is designed to cover the target quantity at one specified value, such as the conditional slope when a moderator equals 2. A collection of such intervals does not automatically give 95% confidence that the entire plotted curve is covered. The distinction matters whenever a reader might interpret a shaded region or series of error bars as a guarantee about the whole curve.
Model and Pointwise Intervals
For the calculations below, consider a linear regression model with \(n\) observations and \(p\) regression coefficients:
Here \(\boldsymbol{\beta}\) is the vector of regression coefficients, and \(\mathbf{x}_i\) is the predictor vector for observation \(i\). For the exact \(t\)-based intervals used here, assume the model is correctly specified, the predictor design has full column rank, and the errors are independent with mean zero and common variance \(\sigma^2\). Assume also that the errors are normally distributed conditional on the predictors. Under these assumptions, the estimated coefficient vector \(\hat{\boldsymbol{\beta}}\) has estimated covariance matrix \(s^2(\mathbf{X}^\mathsf{T}\mathbf{X})^{-1}\), where \(s\) is the residual standard deviation. The degrees of freedom are \(df=n-p\).
Many quantities shown in interaction plots can be written as a linear combination \(c^\mathsf{T}\boldsymbol{\beta}\), where the vector \(c\) is fixed once the plotted predictor value or profile is specified. Its estimate is \(c^\mathsf{T}\hat{\boldsymbol{\beta}}\). The estimated standard error and a two-sided \(100(1-\alpha)\%\) pointwise confidence interval are:
The covariance matrix matters: uncertainty in several coefficients can contribute to the standard error, and their covariances contribute too. It is not generally correct to calculate the standard error by adding coefficient standard errors or by treating the coefficients as independent.
Conditional Slopes Along a Moderator
In a two-predictor interaction model, let \(x\) be a continuous predictor and \(z\) a moderator:
At a fixed moderator value \(z\), the conditional slope of the mean response with respect to \(x\) is \(\beta_1+\beta_3z\). With coefficient order \((\beta_0,\beta_1,\beta_2,\beta_3)\), the corresponding contrast vector is \(c(z)=(0,1,0,z)^\mathsf{T}\). Thus the estimate is \(\hat{\beta}_1+z\hat{\beta}_3\), and its standard error uses the variances and covariance of \(\hat{\beta}_1\) and \(\hat{\beta}_3\).
Worked Example: Conditional-Slope Intervals Across a Moderator Grid
Suppose a hypothetical analysis uses 30 independent observations to fit the interaction model above. The design is full rank, and the residual checks support the assumed linear mean, common error variance, and approximately normal independent errors. There are four coefficients, so \(df=30-4=26\). Suppose the estimates and the covariance matrix for \((\hat{\beta}_1,\hat{\beta}_3)\) are:
Assume \(Y\) is measured in points, \(x\) in hours, and \(z\) in a specified moderator unit. The conditional slope is measured in points per hour. For a 95% interval, \(t_{0.975,26}\approx2.056\). At \(z=0\), the estimated slope is \(1.20+(-0.30)(0)=1.20\). Its standard error is \(\sqrt{0.040}=0.200\), so the interval is:
At \(z=2\), the estimated slope is \(1.20+(-0.30)(2)=0.600\). For \(c=(1,2)^\mathsf{T}\) applied to \((\hat{\beta}_1,\hat{\beta}_3)\), the estimated variance is:
The 95% pointwise interval is \(0.600\pm2.056(0.3162)=[-0.050,\ 1.250]\) points per hour. Each interval concerns the conditional slope at its own specified moderator value. In this hypothetical model, the interval at \(z=2\) includes zero; that is not evidence that the slope is exactly zero there.
Intervals for Fitted Means
A fitted mean at a predictor profile is also a linear combination of the coefficients. In the interaction model, the fitted mean at \((x,z)\) has contrast vector \(c(x,z)=(1,x,z,xz)^\mathsf{T}\). Its standard error is calculated with the full coefficient covariance matrix. The resulting confidence interval concerns the mean response at that profile. It does not describe the range in which an individual future outcome is expected to fall; individual outcomes also vary around the mean because of the error term.
Worked Example: A Pointwise Interval for a Fitted Mean
Suppose a hypothetical study has 40 independent observations and fits the same four-coefficient interaction model. The design is full rank, and the model assumptions for exact \(t\)-based inference are considered reasonable. Thus \(df=40-4=36\). Suppose the coefficient estimates are \((10.0,0.50,2.00,-0.20)\), in the order \((\beta_0,\beta_1,\beta_2,\beta_3)\), and the estimated coefficient covariance matrix is diagonal with entries \((0.25,0.01,0.16,0.0025)\). The diagonal form means the estimated covariances in this hypothetical output are zero.
At the specified profile \(x=2,\ z=1\), the fitted mean is:
The contrast vector is \(c=(1,2,1,2)^\mathsf{T}\). Using the given covariance matrix, the estimated variance and standard error are:
Since \(t_{0.975,36}\approx2.028\), the 95% pointwise confidence interval for the mean response at this profile is:
The interpretation is that this method, applied repeatedly under the stated assumptions, produces intervals that cover the mean response at \(x=2,\ z=1\) in about 95% of samples. The interval is not a 95% prediction interval for one individual outcome.
Reading a Plot of Pointwise Intervals
A plot may show conditional slopes or fitted means at several selected moderator values. An error bar at each value, or a shaded ribbon joining interval endpoints, can display the corresponding pointwise intervals. The intervals can have different widths because the standard error depends on the contrast vector and the coefficient covariance matrix. For a conditional slope, for example, the contrast changes as \(z\) changes.
The coverage statement remains local to each specified value. A 95% interval at \(z=0\) and a 95% interval at \(z=2\) each have their own pointwise interpretation. Neither their visual connection nor their shared regression fit establishes that the full slope curve is covered with 95% confidence. A simultaneous confidence band is designed for a broader coverage claim and requires a different method.
Worked Example: Conditional Slopes for Two Groups
Suppose a hypothetical analysis compares two groups using \(G=0\) for the reference group and \(G=1\) for the other group. The fitted mean is \(E(Y\mid x,G)=\beta_0+\beta_1x+\beta_2G+\beta_3xG\). The slope with respect to \(x\) is \(\beta_1\) for \(G=0\) and \(\beta_1+\beta_3\) for \(G=1\). Assume 44 independent observations, a full-rank design, and residual checks that support the linear-model assumptions stated earlier. With four coefficients, \(df=40\). Suppose \(\hat{\beta}_1=0.80\), \(\hat{\beta}_3=-0.50\), and:
For \(G=0\), the estimated slope is \(0.80\), with standard error \(\sqrt{0.0324}=0.180\). For \(G=1\), the estimated slope is \(0.80-0.50=0.30\). Its estimated variance includes the covariance term:
With \(t_{0.975,40}\approx2.021\), the 95% pointwise intervals are \(0.80\pm2.021(0.180)=[0.436,\ 1.164]\) for \(G=0\), and \(0.30\pm2.021(0.1865)=[-0.077,\ 0.677]\) for \(G=1\). If \(Y\) is measured in points and \(x\) in hours, both slopes and intervals are in points per hour. Each interval concerns one group’s slope. Comparing whether these intervals overlap is not itself a confidence interval or test for the difference between group slopes.
Why the Pointwise Qualification Matters
Suppose a plot displays intervals at ten moderator values. Each interval may have nominal 95% pointwise coverage, but this does not mean there is a 95% probability that all ten intervals cover their respective targets together. The intervals are typically dependent because they use the same estimated coefficients, and their joint coverage is not specified by the individual coverage levels. The same caution applies even more strongly when a continuous ribbon is visually drawn between a finite set of calculated intervals.
Use pointwise intervals when the intended questions concern particular values, such as a conditional slope at a specified moderator value or a fitted mean at a defined profile. Label them as pointwise in the figure or its caption. If the intended claim concerns coverage of an entire curve or many values as a family, a method designed for simultaneous coverage is needed; ordinary pointwise intervals do not establish that claim.
Common Mistake
Wrong reasoning: “Every interval in this 95% ribbon is a 95% interval, so there is 95% confidence that the entire true curve lies inside the ribbon.”
Correction: Each interval has a 95% pointwise coverage interpretation at its own specified value under the model assumptions. The intervals together do not automatically provide 95% simultaneous coverage of the whole curve. State the pointwise interpretation plainly, and do not use a pointwise ribbon to make a stronger whole-curve claim.
Check Your Understanding
Answer each question using the pointwise interpretation and the formulas in this tutorial.
- In an interaction model, why can the standard error of a conditional slope change as the moderator value changes?
- A 95% pointwise interval for a fitted mean includes 12 response units. What does the interval concern, and what does it not describe?
- Why should the covariance between two coefficient estimates be included when calculating the standard error of their sum?
- A plot has 95% pointwise intervals at six moderator values. Does this guarantee 95% coverage of the entire curve? Explain.
- What label or explanation would help prevent readers from interpreting a shaded pointwise ribbon as a simultaneous confidence band?