Tutorials › Generalized Linear Models › Confidence Intervals for Fitted Means

Count Effects and Predictions · Tutorial 478 of 981

Confidence Intervals for Fitted Means

Build confidence intervals for a fitted count mean by quantifying uncertainty in its estimated log mean and transforming the limits back to the count scale.

Intermediate 10 min read

What You'll Learn

  • Calculate the standard error of a fitted log mean at a specified covariate profile
  • Construct a Wald interval on the log-mean scale and exponentiate both endpoints
  • Explain why the resulting interval is positive and generally asymmetric
  • State the regularity conditions behind its approximate coverage
  • Distinguish uncertainty about a fitted mean from uncertainty about a future count

Why Work on the Log-Mean Scale?

In a Poisson regression model, the conditional mean at a covariate profile is positive and is represented by the exponential of a linear predictor. A confidence interval built directly around the estimated mean can fail to respect that positivity, especially when the estimate is small or uncertain. A useful approach is to first quantify uncertainty in the log mean, where the fitted quantity is linear in the regression coefficients, and then exponentiate the two interval endpoints.

The result is a confidence interval for the fitted conditional mean at a specified profile. It is not an interval for an individual future count. The distinction is important: the interval considered here reflects uncertainty in estimating the model’s mean, not the additional count variation around that mean.

Definition: In a Poisson log-link model, let \(x_0\) be the design vector at a specified covariate profile and let \(\beta\) be the regression coefficient vector. The log mean at that profile is \(\eta_0=x_0^\mathsf{T}\beta\), and the conditional mean is \(\mu_0=\exp(\eta_0)\). The fitted values are \(\hat\eta_0=x_0^\mathsf{T}\hat\beta\) and \(\hat\mu_0=\exp(\hat\eta_0)\).

Constructing the Interval

Suppose the estimated coefficient covariance matrix is \(\widehat{\operatorname{Var}}(\hat\beta)\). The estimated variance of the fitted log mean at \(x_0\) is

$$ \widehat{\operatorname{Var}}(\hat\eta_0) =x_0^\mathsf{T}\widehat{\operatorname{Var}}(\hat\beta)x_0, \qquad \widehat{\operatorname{SE}}(\hat\eta_0) =\sqrt{x_0^\mathsf{T}\widehat{\operatorname{Var}}(\hat\beta)x_0}. $$

For a two-sided confidence level of \(100(1-\alpha)\%\), the Wald interval on the log-mean scale is

$$ \left[ \hat\eta_0-z_{1-\alpha/2}\widehat{\operatorname{SE}}(\hat\eta_0), \; \hat\eta_0+z_{1-\alpha/2}\widehat{\operatorname{SE}}(\hat\eta_0) \right], $$

where \(z_{1-\alpha/2}\) is the corresponding standard normal quantile. Because the exponential function is increasing, exponentiating the lower and upper limits gives the interval for the fitted mean:

$$ \left[ \exp\!\left\{\hat\eta_0-z_{1-\alpha/2}\widehat{\operatorname{SE}}(\hat\eta_0)\right\}, \; \exp\!\left\{\hat\eta_0+z_{1-\alpha/2}\widehat{\operatorname{SE}}(\hat\eta_0)\right\} \right]. $$

Both endpoints are positive. The interval is generally not symmetric around \(\hat\mu_0\), even though the interval on the log scale is symmetric around \(\hat\eta_0\). The amount of asymmetry grows with the standard error on the log scale.

Worked Example: A Fitted Mean at a Covariate Profile

At a specified profile, suppose the fitted log mean is \(\hat\eta_0=1.20\) and its estimated standard error is \(0.20\). Construct a 95% Wald confidence interval for the fitted mean. Use \(z_{0.975}=1.96\).

First calculate the margin of error on the log scale:

$$ 1.96(0.20)=0.392. $$

The log-scale interval is therefore

$$ [1.20-0.392,\;1.20+0.392]=[0.808,\;1.592]. $$

Exponentiating each endpoint gives

$$ [\exp(0.808),\;\exp(1.592)]\approx[2.243,\;4.913]. $$

The fitted mean itself is \(\hat\mu_0=\exp(1.20)\approx3.320\). Thus the 95% interval is approximately \([2.243,4.913]\). Its unequal distances from 3.320 reflect the exponential transformation; the limits must be transformed individually, not by adding and subtracting the log-scale margin from the fitted mean.

Using the Coefficient Covariance Matrix

A fitted log mean is a linear combination of the estimated coefficients. Its uncertainty therefore depends on the whole coefficient covariance matrix, including covariances between coefficients. In a Poisson model, a common model-based estimate of that matrix is the inverse observed information matrix evaluated at the fitted coefficients. The particular covariance estimator should match the model and inferential method being used; once it is chosen, it is inserted into the quadratic form \(x_0^\mathsf{T}\widehat{\operatorname{Var}}(\hat\beta)x_0\).

Worked Example: A Binary Treatment Profile

Consider a Poisson regression with log mean \(\eta=\beta_0+\beta_1 x\), where \(x=1\) denotes treatment and \(x=0\) denotes control. Suppose

$$ \hat\beta_0=\log(2),\qquad \hat\beta_1=\log(1.5),\qquad \widehat{\operatorname{Var}}(\hat\beta)= \begin{pmatrix} 0.04 & -0.01\\ -0.01 & 0.02 \end{pmatrix}. $$

Find a 95% interval for the fitted mean in the treatment group. Its design vector is \(x_0=(1,1)^\mathsf{T}\). The fitted log mean is

$$ \hat\eta_0=\hat\beta_0+\hat\beta_1 =\log(2)+\log(1.5)=\log(3)\approx1.0986. $$

The estimated variance of this sum must include the covariance term:

$$ \widehat{\operatorname{Var}}(\hat\eta_0) =0.04+0.02+2(-0.01)=0.04, \qquad \widehat{\operatorname{SE}}(\hat\eta_0)=0.20. $$

Using \(1.96\) as the 95% critical value, the log-scale limits are

$$ 1.0986\pm1.96(0.20) =1.0986\pm0.392 =[0.7066,\;1.4906]. $$

Exponentiating gives

$$ [\exp(0.7066),\;\exp(1.4906)] \approx[2.027,\;4.440]. $$

The estimated treatment mean is \(3\), and the interval is approximately \([2.027,4.440]\). Omitting the covariance would give a variance of \(0.06\), not \(0.04\), and would therefore produce a different interval.

Why the Exponentiated Limits Are a Confidence Interval

The transformation from log mean to mean preserves the coverage event because the exponential function is strictly increasing. This fact does not, by itself, guarantee that a particular log-scale interval has good coverage. It says that whatever coverage the log-scale interval has is carried to the transformed interval.

Result: If an interval \([L,U]\) for \(\eta_0\) has coverage probability \(1-\alpha\), then \([\exp(L),\exp(U)]\) has the same coverage probability for \(\mu_0=\exp(\eta_0)\). If \([L,U]\) has approximate coverage, the transformed interval has the same approximate coverage.

To verify the result, note that for any real numbers \(L,U,\eta_0\) with \(L\le U\),

$$ L\le\eta_0\le U \quad\Longleftrightarrow\quad \exp(L)\le\exp(\eta_0)\le\exp(U). $$

The equivalence holds because the exponential function is strictly increasing. Thus the two interval-coverage events are identical, and so their probabilities are equal. In particular, the equality holds for each sample outcome when the endpoints are random. This proves the transformation result. \(\square\)

When the Wald Interval Has Approximate Coverage

In common applications, the log-scale interval is a Wald interval based on large-sample normal approximation. Its justification requires regularity conditions; it is not generally an exact finite-sample interval. For a fixed-dimensional, correctly specified Poisson regression with independent observations, suppose the true coefficient vector is an interior point of the parameter space, the design provides full-rank information, and the usual regularity conditions for maximum likelihood hold. Assume also that the estimated covariance matrix is consistent for the asymptotic covariance of \(\hat\beta\), and that \(x_0\) is a fixed profile. Under these conditions, the estimated log mean is asymptotically normal after standardization, and its estimated standard error consistently estimates its asymptotic standard deviation.

Theorem: Under the regularity conditions just stated, if the asymptotic variance of \(\hat\eta_0=x_0^\mathsf{T}\hat\beta\) is positive, the exponentiated Wald interval has asymptotic coverage \(1-\alpha\) for \(\mu_0=\exp(x_0^\mathsf{T}\beta)\).

Let \(\eta_0=x_0^\mathsf{T}\beta\), and write \(s_n\) for the true asymptotic standard deviation of \(\hat\eta_0\) at sample size \(n\). The assumed asymptotic normality and covariance consistency give

$$ \frac{\hat\eta_0-\eta_0}{s_n}\xrightarrow{d}N(0,1), \qquad \frac{\widehat{\operatorname{SE}}(\hat\eta_0)}{s_n}\xrightarrow{p}1. $$

By Slutsky’s theorem, their ratio satisfies

$$ \frac{\hat\eta_0-\eta_0} {\widehat{\operatorname{SE}}(\hat\eta_0)} \xrightarrow{d}N(0,1). $$

Consequently, the probability that this ratio lies between \(-z_{1-\alpha/2}\) and \(z_{1-\alpha/2}\) converges to \(1-\alpha\). That event is exactly the event that \(\eta_0\) lies between the two Wald limits for the log mean. By the monotonic-transformation result, it is also exactly the event that \(\mu_0\) lies between the exponentiated limits. Therefore the transformed interval has asymptotic coverage \(1-\alpha\). \(\square\)

Worked Example: Why the Interval Can Be Asymmetric

Suppose a fitted log mean is \(\hat\eta_0=-1.50\), with estimated standard error \(0.60\). Using a 95% critical value of \(1.96\), the log-scale limits are

$$ -1.50\pm1.96(0.60) =-1.50\pm1.176 =[-2.676,\;-0.324]. $$

The fitted mean and transformed confidence limits are

$$ \hat\mu_0=\exp(-1.50)\approx0.2231, \qquad [\exp(-2.676),\;\exp(-0.324)]\approx[0.0688,\;0.723]. $$

For comparison, a symmetric interval around the fitted mean using the first-order standard error \(\hat\mu_0(0.60)\) would have standard error \(0.2231(0.60)\approx0.1339\), and limits \(0.2231\pm1.96(0.1339)\approx[-0.0393,0.4855]\). Its negative lower endpoint is impossible for a mean. The log-scale construction avoids this problem and gives a longer upper side than lower side, as expected on the original scale.

Interpretation and Common Pitfalls

The interval describes uncertainty about the model’s conditional mean at the specified covariate profile. A fitted mean need not be an integer: it is an expected count, not an observed count. Nor does a 95% confidence interval mean that the fixed parameter \(\mu_0\) has a 95% probability of lying in this particular interval. The frequentist statement concerns the long-run coverage of the procedure under repeated sampling and the model assumptions.

  • Using the wrong standard error. The interval requires the standard error of \(\hat\eta_0\), calculated from the full coefficient covariance matrix. A coefficient’s standard error alone is not generally the standard error of a fitted log mean.
  • Forgetting covariance terms. For a sum or other linear combination of coefficients, covariances contribute to its variance. The quadratic form automatically includes them.
  • Exponentiating only the point estimate. The fitted mean is \(\exp(\hat\eta_0)\), but the interval endpoints are obtained by exponentiating the two log-scale limits separately.
  • Calling it an interval for a future observation. This procedure quantifies uncertainty in the fitted mean. It does not account for the additional variability of a future count around that mean.
  • Treating asymptotic coverage as exact. The normal approximation may be unreliable in small samples or when model regularity is poor. The transformed endpoints do not repair a poor approximation on the log scale.

A practical check is to confirm that the fitted mean lies between the two limits, that both limits are positive, and that a larger standard error widens the interval on the log scale. If any of these checks fails, revisit the profile vector, the covariance calculation, and the transformation.

Check Your Understanding

Use the log-scale interval procedure to answer these questions.

  1. At a profile, \(\hat\eta_0=0.70\) and its estimated standard error is \(0.15\). Write the 95% log-scale interval and give the formula for the mean-scale endpoints.
  2. Why must the covariance between two coefficient estimates be included when the fitted log mean is their sum?
  3. Explain why exponentiating both endpoints preserves the coverage event for the conditional mean.
  4. What model quantity does the interval estimate, and what additional source of variation does it not include?
  5. Under what broad conditions should the Wald interval be interpreted as having approximate rather than exact coverage?
Clinical Biostats