Tutorials › Generalized Linear Models › Comparing Adjusted Rates Across Groups

Exposure and Rate Modeling · Tutorial 447 of 981

Comparing Adjusted Rates Across Groups

Estimate and interpret adjusted group-specific rates and contrasts while keeping the comparison’s covariate profile and exposure conditions explicit.

Intermediate 10 min read

What You'll Learn

  • Define an adjusted rate at a specified shared covariate profile
  • Distinguish a rate comparison from a comparison of observed event counts
  • Calculate rate ratios and rate differences from a fitted Poisson model
  • Interpret group-by-covariate interactions in adjusted comparisons
  • Derive uncertainty for a log rate ratio and transform its confidence interval
  • Recognize when an adjusted comparison averages over a common covariate distribution

Why Compare Rates at Shared Conditions?

A group with more observed events does not necessarily have a higher event rate. It may simply have more people at risk, longer follow-up, or a different distribution of risk-related covariates. A model-based adjusted comparison asks a more controlled question: what rates does the fitted model assign to the groups under the same covariate and exposure conditions?

In a Poisson rate model, the expected count depends on both the exposure and the rate. Write \(Y_i\) for the count in record \(i\), \(E_i>0\) for its exposure, and \(\mu_i=E[Y_i]\). A log-link model with an exposure offset has the form \(\log(\mu_i)=\log(E_i)+\eta_i\). The quantity \(\exp(\eta_i)\) is the modeled rate per unit of exposure. Comparing groups means evaluating this rate at shared covariate values, or averaging their predicted rates over the same specified covariate distribution.

Definition: An adjusted rate for group \(g\) at covariate profile \(z\) is the rate \(\exp\{\eta(g,z)\}\) predicted by a fitted rate model after setting the group to \(g\) and the covariates to \(z\). An adjusted rate contrast compares two such rates at the same \(z\), using a stated measure such as a rate ratio or rate difference.

The comparison must specify its target conditions. If the model contains group-by-covariate interactions, the adjusted contrast can change with the selected profile. If the goal is a single comparison over a covariate distribution rather than at one profile, both groups must be predicted over the same target distribution and combined using the same weights.

Defining the Comparison from the Model

For illustration, let \(G_i\) indicate membership in group B, with group A as the reference, and let \(z_i\) be a covariate. A model that allows the group difference to depend on \(z_i\) is

$$ Y_i\mid G_i,z_i,E_i \sim \operatorname{Poisson}(\mu_i), \qquad \log(\mu_i)=\log(E_i)+\beta_0+\beta_G G_i+\beta_z z_i+\beta_{Gz}G_i z_i. $$

The exposure \(E_i\) enters as an offset: its coefficient is fixed at one. The group A rate at \(z\) is \(\exp(\beta_0+\beta_z z)\); the group B rate is \(\exp(\beta_0+\beta_G+(\beta_z+\beta_{Gz})z)\). Dividing the two rates cancels the shared terms, leaving a rate ratio that may depend on \(z\).

$$ r_A(z)=\exp(\beta_0+\beta_z z), \qquad r_B(z)=\exp(\beta_0+\beta_G+(\beta_z+\beta_{Gz})z), \qquad \frac{r_B(z)}{r_A(z)}=\exp(\beta_G+\beta_{Gz}z). $$

Without the interaction, \(\beta_{Gz}=0\), the model implies a constant rate ratio across values of \(z\). With the interaction, \(\beta_G\) alone is the log rate ratio only at \(z=0\). For a contrast at another value, the interaction contribution must be included.

Worked Example: Comparing Groups at Two Covariate Values

Suppose the fitted model has \(\hat{\beta}_0=-3\), \(\hat{\beta}_G=0.4\), \(\hat{\beta}_z=0.2\), and \(\hat{\beta}_{Gz}=-0.3\). Calculate the predicted rates and group B-to-A rate ratios at \(z=0\) and \(z=1\).

At \(z=0\), the group A rate is \(\exp(-3)=0.04979\), and the group B rate is \(\exp(-3+0.4)=\exp(-2.6)=0.07427\), in the model’s exposure units. Their ratio is \(\exp(0.4)=1.492\). Thus, at \(z=0\), the fitted rate for group B is about 49.2% higher.

At \(z=1\), the group A rate is \(\exp(-3+0.2)=\exp(-2.8)=0.06081\). The group B rate is \(\exp(-3+0.4+0.2-0.3)=\exp(-2.7)=0.06721\). The ratio is \(\exp(0.4-0.3)=\exp(0.1)=1.105\), so the fitted rate for group B is about 10.5% higher at this profile.

The group coefficient \(0.4\) does not describe the contrast at every \(z\): the interaction changes the log rate ratio from \(0.4\) at \(z=0\) to \(0.1\) at \(z=1\). Reporting the group coefficient without naming the profile would therefore give an incomplete interpretation.

Shared Exposure and the Difference Between Rates and Counts

For a fixed covariate profile, a model-based rate prediction is \(\exp\{\eta(g,z)\}\). At a chosen exposure \(E^\ast\), the corresponding expected count is \(E^\ast\exp\{\eta(g,z)\}\). If the same positive \(E^\ast\) is used for both groups, the ratio of predicted counts equals the ratio of predicted rates: the common exposure cancels. This does not make the observed counts interchangeable with rates; observed counts can reflect unequal exposure and different covariate profiles.

Result: Under a log-link rate model with a proportional exposure offset, predicted counts for two groups at the same covariate profile and the same exposure have the same ratio as their predicted rates. If exposures differ, the predicted count ratio also includes the exposure ratio.

To verify the result, let the predicted means at the shared profile be \(\mu_A^\ast=E^\ast r_A\) and \(\mu_B^\ast=E^\ast r_B\). Because \(E^\ast>0\),

$$ \frac{\mu_B^\ast}{\mu_A^\ast} = \frac{E^\ast r_B}{E^\ast r_A} = \frac{r_B}{r_A}. $$

If the exposures instead are \(E_A\) and \(E_B\), then \(\mu_B/\mu_A=(E_B/E_A)(r_B/r_A)\). A ratio of counts is then not, by itself, a rate ratio.

Worked Example: Same Exposure, Different Raw Counts

Suppose a fitted model predicts 12 events per 1,000 person-years for group A and 18 per 1,000 person-years for group B at a specified shared covariate profile. At a common exposure of 500 person-years, the predicted counts are

$$ \hat{\mu}_A=500\left(\frac{12}{1000}\right)=6, \qquad \hat{\mu}_B=500\left(\frac{18}{1000}\right)=9. $$

The predicted count ratio is \(9/6=1.5\), which equals the rate ratio \(18/12=1.5\). The rate difference is \(18-12=6\) events per 1,000 person-years; at 500 person-years, that corresponds to an expected-count difference of \(500(6/1000)=3\).

Now consider two observed records with different exposures: group A has 8 events in 400 person-years, while group B has 20 events in 2,000 person-years. Their crude rates are \(8/400=0.02\) and \(20/2000=0.01\) events per person-year. Although group B has more observed events, its crude rate is half group A’s. These crude rates still do not constitute an adjusted comparison if the groups differ in covariates; the model comparison requires predictions at shared covariate conditions.

Adjusted Comparisons Over a Shared Covariate Distribution

A single covariate profile may not be the most relevant target. For a finite set of target profiles \(z_1,\ldots,z_K\), choose weights \(w_k\geq 0\) with \(\sum_{k=1}^K w_k=1\). The adjusted rate for group \(g\), averaged over this common target, is

$$ R_g=\sum_{k=1}^K w_k\exp\{\eta(g,z_k)\}. $$

Both groups use the same profiles and weights. One may report \(R_B/R_A\) or \(R_B-R_A\). When the model has interactions, these averaged contrasts generally cannot be obtained by exponentiating the group coefficient: each profile’s predicted rate must first be calculated, then averaged. The target profiles and weights determine what population the comparison describes.

Worked Example: Averaging Over Two Shared Profiles

Suppose a fitted model gives group A rates of 10 and 20 events per 1,000 person-years at two covariate profiles. At those same profiles, group B rates are 15 and 18. Let the target weights be \(w_1=0.75\) and \(w_2=0.25\) for both groups.

The adjusted group A rate is \(R_A=0.75(10)+0.25(20)=7.5+5=12.5\) events per 1,000 person-years. The adjusted group B rate is \(R_B=0.75(15)+0.25(18)=11.25+4.5=15.75\) events per 1,000 person-years.

The adjusted rate difference is \(15.75-12.5=3.25\) events per 1,000 person-years. The adjusted rate ratio is \(15.75/12.5=1.26\). The same weights are essential: comparing group A under one covariate mix with group B under another would not isolate the group contrast at a common target.

Uncertainty for a Model-Based Rate Ratio

At a fixed profile in a log-link model, a log rate ratio is often a linear contrast of the model coefficients. Write the coefficient vector as \(\beta\), its estimator as \(\hat{\beta}\), and let \(c\) be a known contrast vector. Then \(\log(r_B/r_A)=c^\mathsf{T}\beta\), estimated by \(c^\mathsf{T}\hat{\beta}\). For the interaction model above at covariate value \(z_0\), the contrast is \(\beta_G+z_0\beta_{Gz}\).

Theorem: Suppose the model is correctly specified, the relevant parameter is identifiable, and the maximum-likelihood estimator is asymptotically normal with a consistently estimated covariance matrix \(\widehat{\operatorname{Cov}}(\hat{\beta})\). For a fixed, estimable contrast \(c^\mathsf{T}\beta\), its estimated variance is \(c^\mathsf{T}\widehat{\operatorname{Cov}}(\hat{\beta})c\). A large-sample Wald interval for the log rate ratio is \(c^\mathsf{T}\hat{\beta}\ \pm\ z_{1-\alpha/2}\sqrt{c^\mathsf{T}\widehat{\operatorname{Cov}}(\hat{\beta})c}\). Exponentiating both endpoints gives an interval for the rate ratio.

The variance expression follows from the variance rule for linear combinations: for a random vector \(U\) with covariance matrix \(\Sigma\), \(\operatorname{Var}(c^\mathsf{T}U)=c^\mathsf{T}\Sigma c\). Applying this to the asymptotic distribution of \(\hat{\beta}\) gives the stated estimated standard error. Under the stated asymptotic-normality and consistency conditions, dividing the centered contrast by that standard error converges in distribution to \(N(0,1)\), by Slutsky’s theorem. The Wald interval is therefore a large-sample interval, not an exact finite-sample guarantee.

Worked Example: A Rate-Ratio Confidence Interval

Suppose the estimated log rate ratio for group B versus group A at a specified profile is \(0.4055\), with standard error \(0.1000\). Using a 95% Wald interval and \(z_{0.975}=1.96\), the estimated rate ratio is \(\exp(0.4055)=1.500\) (to three decimal places).

The log-scale margin of error is \(1.96(0.1000)=0.1960\). Thus the interval on the log scale is

$$ 0.4055\pm0.1960=(0.2095,\ 0.6015). $$

Exponentiating gives \((\exp(0.2095),\exp(0.6015))\approx(1.233,\ 1.825)\). The endpoints are ordered because the exponential function is increasing. The interval indicates that, under the model and its large-sample approximation, the rate for group B at the target profile is estimated to be between 1.233 and 1.825 times the rate for group A. It is not an interval for a difference in events or a comparison of unadjusted counts.

Common Mistakes and Interpretation

  • Comparing event totals instead of rates. A larger total can arise from greater exposure. Calculate or model rates using the exposure information before interpreting a group contrast.
  • Calling a coefficient an adjusted comparison without checking interactions. In an interaction model, the group coefficient is the log rate ratio only at the reference covariate value. Include the interaction terms for the chosen profile.
  • Comparing predictions at different covariate values. An adjusted group contrast should use the same profile, or the same target profiles and weights, for both groups.
  • Exponentiating a rate difference. Exponentiating a log rate ratio yields a rate ratio. A rate difference is obtained by subtracting predicted rates on their original scale.
  • Ignoring the exposure units. A rate stated per person-year differs numerically from a rate stated per 1,000 person-years by a factor of 1,000. State the unit when reporting rates and rate differences.

Adjusted comparisons are useful because they make the conditions of a model-based group contrast explicit. Their meaning depends on the fitted model, the covariates included, and the selected profile or target distribution. They do not automatically establish a causal effect: that interpretation requires additional design and causal assumptions beyond the rate-model calculation.

Check Your Understanding

Use the model scale and comparison target carefully when answering.

  1. In a log-link rate model with a group-by-covariate interaction, which terms determine the group log rate ratio at \(z=z_0\)?
  2. Why can the group with more observed events have a lower crude rate?
  3. If both groups have the same covariate profile and exposure, why does the ratio of their predicted counts equal the ratio of their predicted rates?
  4. When averaging predicted rates over several covariate profiles, what must be held common across groups?
  5. A log rate-ratio estimate is \(0.2\). Is the rate ratio \(0.2\), or must a transformation be applied? Explain.
Clinical Biostats