Comparing Two Covariate Profiles
A Poisson regression model describes how a conditional mean changes with covariates. In many applications, the question is not the fitted mean for one profile on its own, but how the fitted mean for one profile compares with that for another. For example, a researcher may want to compare expected counts for patients who differ in treatment status and age. The key calculation is a ratio: take the difference between the two profiles’ linear predictors, then exponentiate that difference.
The result depends on the fitted coefficients and on how both profiles are represented in the model’s design rows. When profiles differ in several predictors, all the corresponding terms contribute. If the model includes interactions, those terms contribute too.
The Design-Row Contrast
A design vector records the predictor values in the exact form used by the model. It contains a 1 for the intercept, the coded values of quantitative and categorical predictors, and any columns for transformations or interactions included in the model. The order of its entries must match the order of the coefficients.
The comparison can be calculated without first finding either absolute fitted mean. Subtract the design vector for B from the design vector for A, multiply the resulting contrast by the fitted coefficients, and exponentiate. The intercept entries are both 1, so the intercept cancels. But other shared covariate values cancel only when their contributions are the same in both design rows.
Proof. By the log-link form, \(\hat{\mu}(\mathbf{x}_A)=\exp(\mathbf{x}_A^{\top}\hat{\boldsymbol{\beta}})\) and \(\hat{\mu}(\mathbf{x}_B)=\exp(\mathbf{x}_B^{\top}\hat{\boldsymbol{\beta}})\). Since the exponential is positive, division gives
The exponential function is strictly increasing and takes positive values. Thus, the ratio exceeds, equals, or falls below 1 according as the difference between the two fitted linear predictors is positive, zero, or negative. \(\square\)
Worked Example: Two Continuous Predictors
Suppose a fitted model for a count has design vector \(\mathbf{x}=(1,\text{age},\text{severity})^{\top}\) and coefficient vector \(\hat{\boldsymbol{\beta}}=(-0.80,0.03,0.20)^{\top}\). Compare a profile with age 60 and severity score 4 (A) with one of age 50 and severity score 2 (B).
The design vectors are \(\mathbf{x}_A=(1,60,4)^{\top}\) and \(\mathbf{x}_B=(1,50,2)^{\top}\). Their difference is \(\mathbf{x}_A-\mathbf{x}_B=(0,10,2)^{\top}\). The intercept cancels, and the difference in fitted linear predictors is
Therefore, the fitted-mean ratio for A compared with B is \(\exp(0.70)\approx 2.014\). The model’s fitted conditional mean for A is about 2.01 times that for B. This comparison combines both differences; it is not the interpretation of either slope alone.
As a check on direction, A has both a larger age and a larger severity score, and both fitted coefficients are positive. The resulting ratio is above 1, as the calculation shows.
Multiple Predictors and Interactions
With categorical predictors, the design entries depend on the chosen coding. For example, under reference-level indicator coding, a factor with levels “control” and “treated” may be represented by 0 and 1. A profile’s design row must use the same coding as the fitted model. Coefficients cannot be attached to verbal category labels without first identifying their design entries.
An interaction adds a design column formed from the relevant predictor values. Consequently, a comparison that changes a predictor involved in an interaction may depend on the values of other predictors. A coefficient for treatment, for instance, need not be the treatment comparison at every age if the model includes a treatment-by-age interaction.
Worked Example: Treatment and Age With an Interaction
Let \(T=1\) for treatment and \(T=0\) for control. Age is represented as \(A=\text{age}-50\), so age 50 has \(A=0\). Consider the fitted model
Compare a treated profile aged 60 (A) with a control profile aged 50 (B). In the design order \((1,T,A,TA)\), profile A has row \((1,1,10,10)\), because \(TA=1(10)=10\). Profile B has row \((1,0,0,0)\). Thus the contrast is \((0,1,10,10)\), and the difference in fitted linear predictors is
Exponentiating gives \(\exp(0.60)\approx 1.822\). The fitted conditional mean for the treated, 60-year-old profile is about 1.82 times the mean for the control, 50-year-old profile. The interaction contributes \(-0.10\) to the log-ratio; omitting it would give the incorrect ratio \(\exp(0.70)\).
The design-row method also makes clear why the treatment coefficient alone is not this comparison: the two profiles differ in age as well as treatment, and their interaction entries differ.
Worked Example: Several Categorical and Continuous Differences
Suppose a model uses \(S=1\) for a smoker and 0 otherwise, \(G=1\) for group 2 and 0 for the reference group 1, and a continuous score \(Z\). Its design order is \((1,S,G,Z)\), with fitted coefficients \((0.20,0.40,-0.30,0.05)\). Compare A, a smoker in group 2 with \(Z=8\), with B, a nonsmoker in group 1 with \(Z=6\).
The design rows are \(\mathbf{x}_A=(1,1,1,8)^{\top}\) and \(\mathbf{x}_B=(1,0,0,6)^{\top}\). Hence their contrast is \((0,1,1,2)^{\top}\). The fitted linear-predictor difference is
Therefore, the ratio for A compared with B is \(\exp(0.20)\approx 1.221\). The combined profile has a fitted mean about 1.22 times that of B. The smoking and group terms act in opposite directions, while the two-unit increase in \(Z\) contributes \(2(0.05)=0.10\) to the log-ratio.
The calculation uses the coefficients as fitted, without changing their signs or treating the coded values as labels. Reversing the comparison would negate the contrast and give \(\exp(-0.20)\approx 0.819\), the reciprocal of 1.221 (up to rounding).
Useful Checks on a Comparison
The ratio is tied to the order in which profiles are named: “A compared with B” means A’s fitted mean divided by B’s. Reversing the order gives the reciprocal. More generally, comparisons across three profiles are internally consistent: the ratio from A to C equals the product of the ratio from A to B and the ratio from B to C.
Proof. Each fitted mean is positive because it is an exponential. The product on the right is therefore defined, and cancellation of the positive middle term gives
Equivalently, the two design-row contrasts add: \((\mathbf{x}_A-\mathbf{x}_B)+(\mathbf{x}_B-\mathbf{x}_C)=\mathbf{x}_A-\mathbf{x}_C\). Exponentiating the sum gives the product of the corresponding exponentials. \(\square\)
A practical workflow is to write both profiles in the model’s design order, subtract the rows, take the coefficient-weighted sum, and exponentiate once at the end. Then state the comparison’s direction and meaning in context. If the model includes transformed predictors or interactions, calculate those entries for each profile rather than assuming they cancel.
Common Mistakes
- Comparing coefficients without comparing profiles. A coefficient describes a particular design contrast, not every possible profile comparison. When several covariates differ, use the entire row difference.
- Forgetting to exponentiate. The coefficient-weighted contrast is a difference in log means. The ratio of means is its exponential, not the contrast itself.
- Dropping an interaction term. If the profiles have different interaction entries, its coefficient contributes to the comparison even when the main-effect coefficients seem to tell a simple story.
- Reversing the ratio’s direction. A compared with B is \(\hat{\mu}_A/\hat{\mu}_B\). B compared with A is its reciprocal.
Check Your Understanding
For each question, identify the relevant design-row contrast before interpreting a ratio.
- Why does the intercept cancel when comparing two profiles in a model that includes an intercept?
- A profile contrast has fitted linear-predictor difference \(-0.25\). What is the fitted-mean ratio for the first profile compared with the second, and is it above or below 1?
- In a model with a treatment-by-age interaction, why can the treatment coefficient alone fail to give the treatment comparison at age 70?
- If the fitted-mean ratio for A compared with B is 1.5, what is the ratio for B compared with A?
- Two profiles differ in two indicators and a continuous predictor. What calculation combines all three differences into one fitted-mean ratio?