Why Compare Fitted Means?
A fitted mean gives the model’s expected count at a specified covariate profile. Often, however, the scientific question is comparative: how do the expected counts for two profiles differ, and how uncertain is that comparison? The two means are calculated from the same fitted model, so their uncertainties are usually connected. A comparison that ignores this connection can give the wrong standard error.
Consider a Poisson log-mean model with coefficient vector \(\beta\). For a profile with design vector \(x\), its fitted conditional mean is \(\mu(x;\beta)=\exp(x^\mathsf{T}\beta)\). We compare two fixed profiles, denoted \(A\) and \(B\), with design vectors \(x_A\) and \(x_B\). The aim is to estimate either their ratio or their difference, not to average predictions over a population of profiles.
The coefficient estimates are typically treated as approximately jointly normal in large samples, with an estimated covariance matrix \(\widehat V=\widehat{\operatorname{Cov}}(\hat\beta)\). The off-diagonal entries matter: they describe how coefficient estimates vary together. Since both fitted means use the same coefficient vector, their estimation errors are generally correlated as well.
Comparing Means on the Log Scale
The log link makes a ratio especially direct. Subtract the two linear predictors before exponentiating. With \(c=x_A-x_B\), the log ratio is a coefficient contrast:
Thus the fitted log ratio is \(c^\mathsf{T}\hat\beta\). Its estimated variance is \(c^\mathsf{T}\widehat Vc\), using the full covariance matrix. Exponentiating the contrast gives the fitted ratio. A confidence interval is most naturally formed on the log scale and then exponentiated, so the resulting interval respects the positive scale of a ratio.
The contrast representation also clarifies which coefficient uncertainty matters. Any coefficient whose entries in \(x_A\) and \(x_B\) are identical cancels from \(c\). For example, if both profiles have the same intercept entry, uncertainty in the intercept does not contribute to the log-ratio variance by itself. The covariance calculation still uses all entries of \(c\) and \(\widehat V\); it is not generally valid to add coefficient variances while discarding covariances.
Worked Example: A Ratio for Two Indicator Profiles
Suppose a fitted model has an intercept and a treatment indicator, with \(\hat\beta=(1.10,\,0.35)^\mathsf{T}\) and estimated covariance matrix \[ \widehat V= \begin{pmatrix} 0.040 & -0.012\\ -0.012 & 0.0625 \end{pmatrix}. \] Profile \(A\) has indicator value 0, and profile \(B\) has indicator value 1, so \(x_A=(1,0)^\mathsf{T}\) and \(x_B=(1,1)^\mathsf{T}\).
The fitted log means are \(x_A^\mathsf{T}\hat\beta=1.10\) and \(x_B^\mathsf{T}\hat\beta=1.45\). Therefore \(\hat\mu_A=\exp(1.10)\approx3.004\) and \(\hat\mu_B=\exp(1.45)\approx4.263\). Their fitted ratio, in the order \(A/B\), is \[ \exp(1.10-1.45)=\exp(-0.35)\approx0.705. \]
Here \(c=x_A-x_B=(0,-1)^\mathsf{T}\), so \[ c^\mathsf{T}\widehat Vc=0.0625,\qquad \operatorname{SE}(c^\mathsf{T}\hat\beta)=\sqrt{0.0625}=0.25. \] The 95% interval on the log scale is \(-0.35\pm1.96(0.25)=[-0.84,\,0.14]\). Exponentiating the endpoints gives the ratio interval \([\exp(-0.84),\,\exp(0.14)]\approx[0.432,\,1.150]\). The interval includes 1, the value corresponding to equal fitted means.
Comparing Means by Their Difference
A difference is not a linear function of the coefficients because each mean is an exponential. Its uncertainty can nevertheless be approximated by the delta method. Define \(g(\beta)=\mu_A-\mu_B\). Differentiating the two exponentials gives \[ \nabla g(\beta)=\mu_Ax_A-\mu_Bx_B. \] Consequently, a first-order estimated variance for the fitted difference is \[ (\hat\mu_Ax_A-\hat\mu_Bx_B)^\mathsf{T} \widehat V (\hat\mu_Ax_A-\hat\mu_Bx_B). \] The fitted means in this expression are evaluated at \(\hat\beta\).
Equivalently, the delta method gives estimated variances \(\hat\mu_A^2x_A^\mathsf{T}\widehat Vx_A\) and \(\hat\mu_B^2x_B^\mathsf{T}\widehat Vx_B\) for the two fitted means, and estimated covariance \(\hat\mu_A\hat\mu_Bx_A^\mathsf{T}\widehat Vx_B\) between them. The variance of their difference is the first variance plus the second variance minus twice the covariance. This subtraction is essential when the fitted means move together as the coefficients vary.
Record both design vectors and keep the order of the comparison clear: \(A/B\) for a ratio or \(A-B\) for a difference.
Evaluate \(x_A^\mathsf{T}\hat\beta\) and \(x_B^\mathsf{T}\hat\beta\), then exponentiate to obtain \(\hat\mu_A\) and \(\hat\mu_B\).
For a ratio, use \(c^\mathsf{T}\widehat Vc\). For a difference, use the gradient \(\hat\mu_Ax_A-\hat\mu_Bx_B\) on both sides of \(\widehat V\).
Give the estimated ratio or difference, its standard error or interval, the profile order, and a clear interpretation in context.
Worked Example: A Difference With Correlated Fitted Means
Suppose \(\hat\beta=(\log 4,\,\log 2)^\mathsf{T}\) and \[ \widehat V= \begin{pmatrix} 0.04 & -0.01\\ -0.01 & 0.09 \end{pmatrix}. \] Compare \(A\), with \(x_A=(1,0)^\mathsf{T}\), to \(B\), with \(x_B=(1,1)^\mathsf{T}\). The fitted means are \(\hat\mu_A=4\) and \(\hat\mu_B=8\), so the estimated difference \(A-B\) is \(-4\).
The gradient of the difference at the fitted coefficients is \[ \hat\mu_Ax_A-\hat\mu_Bx_B=(4,0)^\mathsf{T}-(8,8)^\mathsf{T}=(-4,-8)^\mathsf{T}. \] Its estimated first-order variance is \[ (-4,-8) \begin{pmatrix}0.04&-0.01\\-0.01&0.09\end{pmatrix} \begin{pmatrix}-4\\-8\end{pmatrix} =0.64+5.76-0.64=5.76. \] The standard error is therefore \(\sqrt{5.76}=2.4\), and the approximate 95% interval for \(A-B\) is \(-4\pm1.96(2.4)=[-8.704,\,0.704]\).
The covariance contribution can also be checked directly. The estimated variances of the two fitted means are \(4^2(0.04)=0.64\) and \(8^2(0.04+0.09-0.02)=7.04\). Their estimated covariance is \(4(8)(0.04-0.01)=0.96\). Hence the difference variance is \(0.64+7.04-2(0.96)=5.76\), matching the gradient calculation. If the covariance were incorrectly omitted, the variance would be \(0.64+7.04=7.68\), and the standard error would be \(\sqrt{7.68}\approx2.771\), rather than 2.4.
One Pair of Profiles, Two Scales
A ratio and a difference answer different questions. A ratio describes relative change and is naturally tied to the log-mean contrast. A difference describes the absolute change in expected counts and depends on the levels of both means, not just on their ratio. Because the difference is nonlinear in the coefficients, its first-order uncertainty need not be inferred from the ratio interval.
Worked Example: Ratio and Difference for a Two-Unit Change
Consider \(\hat\beta=(\log 3,\,\log 1.5)^\mathsf{T}\) with \[ \widehat V= \begin{pmatrix} 0.04&0.006\\ 0.006&0.0225 \end{pmatrix}. \] Compare \(A\), at \(x_A=(1,0)^\mathsf{T}\), with \(B\), at \(x_B=(1,2)^\mathsf{T}\). The fitted means are \(\hat\mu_A=3\) and \(\hat\mu_B=3(1.5)^2=6.75\).
For the ratio \(A/B\), the contrast is \(c=(0,-2)^\mathsf{T}\), so the fitted ratio is \(\exp(-2\log 1.5)=4/9\approx0.4444\). Its log-scale standard error is \[ \sqrt{c^\mathsf{T}\widehat Vc}=\sqrt{4(0.0225)}=0.30. \] The log ratio is \(\log(4/9)\approx-0.81093\). A 95% log-scale interval is \(-0.81093\pm1.96(0.30)=[-1.39893,\,-0.22293]\), giving a ratio interval of approximately \([0.247,\,0.800]\) after exponentiation.
For the difference \(A-B\), the estimate is \(3-6.75=-3.75\), and its gradient is \((3,0)^\mathsf{T}-(6.75,13.5)^\mathsf{T}=(-3.75,-13.5)^\mathsf{T}\). The variance calculation is \[ 0.04(3.75^2)+0.0225(13.5^2)+2(0.006)(3.75)(13.5) =0.5625+4.100625+0.6075=5.270625. \] Thus the standard error is approximately \(2.296\). The approximate 95% interval for \(A-B\) is \(-3.75\pm1.96\sqrt{5.270625}\approx[-8.250,\,0.750]\). The ratio communicates a relative comparison; the difference communicates the estimated change in expected counts.
What the Approximation Does—and Does Not—Say
The delta-method calculation for a difference is a first-order approximation. More precisely, for a differentiable function \(g\), a Taylor expansion around the true coefficient vector has a remainder \(o_p(\|\hat\beta-\beta\|)\). If the gradient is nonzero and the estimator has the usual asymptotic normal behavior, this gives the standard first-order approximation for the transformed estimator. If the gradient is zero, the first-order variance can be degenerate; it does not then establish that higher-order uncertainty is absent. Further analysis may be needed in that case.
The intervals here concern uncertainty in the model-based conditional means at fixed profiles. They are not prediction intervals for future observed counts. A future count has sampling variation in addition to uncertainty about the fitted coefficients, a distinction that matters especially for count outcomes.
Common Mistake: Treating the Predictions as Independent
A tempting shortcut is to calculate a standard error for each fitted mean and then add their variances to obtain the variance of a difference. That calculation assumes the fitted means are uncorrelated. It is generally wrong when both predictions use the same estimated coefficients. The correct identity is \[ \operatorname{Var}(\hat\mu_A-\hat\mu_B) =\operatorname{Var}(\hat\mu_A)+\operatorname{Var}(\hat\mu_B) -2\operatorname{Cov}(\hat\mu_A,\hat\mu_B), \] with the covariance estimated from the shared coefficient covariance matrix. For a ratio, the corresponding correction is to form the coefficient contrast first and use \(c^\mathsf{T}\widehat Vc\), rather than treating the two log means as independent.
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- For two profiles with design vectors \(x_A\) and \(x_B\), what coefficient contrast gives the log ratio \(\log(\mu_A/\mu_B)\)?
- Why can an intercept contribute no uncertainty to a ratio when both profiles have the same intercept entry?
- Write the delta-method gradient for the fitted difference \(\mu_A-\mu_B\).
- What covariance term must be included when calculating the variance of a fitted difference?
- Why does an interval for a fitted conditional mean comparison not, by itself, describe the variability of a future count?