Tutorials › Generalized Linear Models › Indicator Effects and Baseline Counts

Count Effects and Predictions · Tutorial 470 of 981

Indicator Effects and Baseline Counts

Interpret a binary indicator on the expected-count scale and calculate fitted means for the reference and comparison groups at a stated covariate profile.

Intermediate 10 min read

What You'll Learn

  • Identify the reference group under zero-one indicator coding
  • Convert a log-mean indicator coefficient into an expected-count ratio
  • Calculate both groups’ fitted counts from a specified baseline profile
  • Distinguish a relative count change from an absolute count difference
  • Recognize why rounded coefficients give approximate, not exact, fitted counts

From an Indicator Coefficient to a Count Comparison

A binary predictor divides observations into two groups, such as patients who received a treatment and patients who did not. In a count model with a log link, its coefficient describes a comparison on the log-mean scale. Exponentiating that coefficient gives the corresponding comparison on the expected-count scale: a ratio against the reference group.

A ratio alone does not give the fitted expected counts for either group. To calculate those, we also need a baseline profile: a specified value for each other predictor. The reference group’s fitted count at that profile is the baseline count; multiplying it by the indicator’s expected-count ratio gives the comparison group’s fitted count.

Definition: Let \(Z\) be a binary indicator coded \(0\) for the reference group and \(1\) for the comparison group. At a covariate profile \(x\), consider a log-mean model $$ \log \mu(z,x)=\beta_0+\beta_Z z+\sum_{j=1}^{p}\gamma_j x_j, $$ where \(\mu(z,x)=E[Y\mid Z=z,X=x]\) is the conditional expected count. The coefficient \(\beta_Z\) is the indicator coefficient. Under this coding, \(e^{\beta_Z}\) is the comparison group’s expected count divided by the reference group’s expected count, with the other predictors held fixed.

The coding matters. Here \(Z=0\) defines the reference group, so setting \(z=0\) removes the indicator term from the linear predictor. Setting \(z=1\) adds \(\beta_Z\). The interpretation does not require a particular baseline count, but the fitted counts do: they depend on the intercept and the other predictors at the chosen profile.

The Ratio and Baseline-Count Results

The central calculation follows directly from the log-mean model. Write the linear predictor for the reference group at a fixed profile \(x\) as \(\eta_0(x)=\beta_0+\sum_{j=1}^{p}\gamma_jx_j\). The comparison group’s linear predictor at the same profile is \(\eta_0(x)+\beta_Z\).

Theorem: In the stated model, for any fixed profile \(x\), the ratio of the comparison group’s conditional expected count to the reference group’s conditional expected count is \(e^{\beta_Z}\). Thus this ratio is constant across profiles represented by the model.

Proof. Applying the inverse log link to the two linear predictors gives

$$ \mu(0,x)=e^{\eta_0(x)} \qquad\text{and}\qquad \mu(1,x)=e^{\eta_0(x)+\beta_Z}. $$

Because \(e^{\eta_0(x)}>0\), division is valid. Cancelling the common factor yields

$$ \frac{\mu(1,x)}{\mu(0,x)} = \frac{e^{\eta_0(x)+\beta_Z}}{e^{\eta_0(x)}} = e^{\beta_Z}. $$

This establishes the ratio for every fixed profile \(x\). The constancy across profiles follows because the expression \(e^{\beta_Z}\) contains no \(x\). \(\square\)

Theorem: If the reference group’s fitted mean at profile \(x\) is \(m_0=\mu(0,x)\), then the comparison group’s fitted mean is \(m_1=m_0e^{\beta_Z}\). The difference between the fitted means is \(m_1-m_0=m_0(e^{\beta_Z}-1)\).

Derivation. The ratio result gives \(\mu(1,x)/\mu(0,x)=e^{\beta_Z}\). Substituting \(m_0=\mu(0,x)\) and multiplying both sides by \(m_0\) gives \(m_1=m_0e^{\beta_Z}\). Subtracting \(m_0\) from both sides gives

$$ m_1-m_0=m_0e^{\beta_Z}-m_0=m_0(e^{\beta_Z}-1). $$

Thus the coefficient determines a relative change, while the baseline count determines the size of the corresponding absolute difference. \(\square\)

Calculating Both Groups at a Baseline Profile

To obtain fitted counts, first specify all predictor values. Then calculate the reference group’s linear predictor and exponentiate it. Finally, add the indicator coefficient to get the comparison group’s linear predictor, or multiply the reference group’s fitted mean by \(e^{\beta_Z}\). These are equivalent calculations, subject to ordinary rounding.

1
Specify the profile.
Record the values of the other predictors at which the comparison is to be made.
2
Calculate the reference mean.
Set \(Z=0\), evaluate the linear predictor, and exponentiate it.
3
Calculate the comparison mean.
Set \(Z=1\), or multiply the reference mean by \(e^{\beta_Z}\).
4
Check the comparison.
Verify that the ratio of fitted means agrees with \(e^{\beta_Z}\), allowing for rounding.

Worked Example: An Indicator With an Exact Ratio

Suppose a model for the expected number of events per patient is \(\log\mu(z)=\log(12)+\log(1.5)z\), where \(z=0\) denotes the reference group and \(z=1\) the comparison group. Find the fitted mean for each group and interpret the indicator coefficient.

For the reference group, set \(z=0\):

$$ \mu(0)=\exp\{\log(12)+\log(1.5)(0)\} =\exp\{\log(12)\} =12. $$

The coefficient is \(\beta_Z=\log(1.5)\), so the expected-count ratio is \(e^{\beta_Z}=1.5\). For the comparison group:

$$ \mu(1)=\exp\{\log(12)+\log(1.5)\} =12(1.5) =18. $$

The fitted comparison mean is 18 events per patient, compared with 12 for the reference group. Their ratio is \(18/12=1.5\), as required. The fitted difference is \(18-12=6\) events per patient; that difference is not the coefficient itself.

Worked Example: Using a Rounded Coefficient

Consider \(\log\mu(z)=\log(10)-0.287682z\), with \(z=0\) as the reference group. Calculate the fitted means, taking care to distinguish a rounded coefficient from an exact logarithm.

For \(z=0\), the fitted mean is exactly

$$ \mu(0)=\exp\{\log(10)\}=10. $$

The comparison group’s fitted mean, using the coefficient as written, is

$$ \mu(1)=\exp\{\log(10)-0.287682\} =10\exp(-0.287682) \approx 10(0.7500000543) \approx 7.500000543. $$

The corresponding ratio is \(e^{-0.287682}\approx0.7500000543\). It is close to \(0.75\), but it is not exactly \(0.75\), because \(-0.287682\) is a rounded value rather than the exact value \(\log(0.75)\). In practical reporting the fitted mean is about 7.5, but the calculation from the stated model is approximate, not an exact equality to 7.5.

Including Other Predictors in the Baseline Profile

A baseline profile need not set every other predictor to zero. It means the particular values at which the comparison is requested. If a continuous predictor has been centered, for example, a value of zero may represent its centering point rather than a raw measurement of zero. The safest approach is to state the profile explicitly and substitute its values into the model.

Worked Example: Fitted Counts at Two Values of a Predictor

Suppose a count model is \(\log\mu(z,x)=\log(20)+\log(1.2)(x-5)+\log(0.8)z\). Here \(z=0\) is the reference group, \(z=1\) is the comparison group, and \(x\) is a continuous predictor. Find the fitted means for both groups at \(x=5\), then at \(x=7\).

At \(x=5\), the term \(\log(1.2)(x-5)\) is zero. For the reference group,

$$ \mu(0,5)=\exp\{\log(20)\}=20. $$

For the comparison group, the indicator multiplies the reference mean by \(e^{\log(0.8)}=0.8\):

$$ \mu(1,5)=20(0.8)=16. $$

At \(x=7\), the continuous-predictor contribution is \(\log(1.2)(7-5)=\log(1.2^2)\). Therefore the reference group’s mean is

$$ \mu(0,7)=20(1.2^2)=20(1.44)=28.8. $$

The comparison group’s mean at the same profile is

$$ \mu(1,7)=28.8(0.8)=23.04. $$

At either value of \(x\), the fitted-mean ratio is \(0.8\): \(16/20=0.8\) and \(23.04/28.8=0.8\). The reference mean changes with \(x\), so the absolute difference changes as well: it is \(16-20=-4\) at \(x=5\) and \(23.04-28.8=-5.76\) at \(x=7\).

Interpreting the Size and Direction of the Effect

The sign of \(\beta_Z\) and the size of \(e^{\beta_Z}\) describe the same comparison on different scales. If \(\beta_Z=0\), then \(e^{\beta_Z}=1\), so the fitted means are equal at a fixed profile. If \(\beta_Z>0\), then \(e^{\beta_Z}>1\), so the comparison group has the larger fitted mean. If \(\beta_Z<0\), then \(0<e^{\beta_Z}<1\), so its fitted mean is smaller.

For instance, a ratio of \(0.8\) means the comparison group’s fitted mean is 80% of the reference group’s, or 20% lower, at the specified profile. It does not mean a reduction of 0.8 events. The absolute difference depends on the baseline mean: a ratio of \(0.8\) corresponds to a difference of \(-4\) when the reference mean is 20, but a difference of \(-2\) when it is 10.

These interpretations concern fitted conditional expected counts, not the count that every individual will experience. If the response is modeled as Poisson, for example, an individual outcome remains random even when its conditional expected count is specified. The model’s mean comparison should not be read as a guarantee about individual outcomes.

Common Mistakes

  • Calling the coefficient the count ratio. The coefficient \(\beta_Z\) is on the log-mean scale; the expected-count ratio is \(e^{\beta_Z}\).
  • Reversing the comparison. With \(Z=0\) as the reference and \(Z=1\) as the comparison group, the ratio is \(\mu(1,x)/\mu(0,x)\). Reversing the numerator and denominator gives \(e^{-\beta_Z}\).
  • Reporting a relative effect as an absolute difference. A ratio of \(1.5\) means 50% higher, not 1.5 additional events. Calculate both fitted means before finding their difference.
  • Treating a rounded coefficient as exact. If a decimal coefficient only approximates a logarithm, exponentiating it gives an approximate ratio. Use \(\approx\), and do not claim an exact fitted mean that the stated coefficient does not produce.
  • Leaving the baseline profile unstated. A fitted count depends on the values of the other predictors. State those values before reporting the two fitted means.
Key takeaway: Under zero-one indicator coding in a log-mean model, exponentiating the indicator coefficient gives the comparison group’s expected-count ratio relative to the reference group. To obtain fitted counts, calculate the reference mean at a stated profile, then multiply it by that ratio.

Check Your Understanding

Use the model and coding stated in each question, and show the calculation that supports your answer.

  1. In a log-mean model, the indicator coefficient is \(\log(2)\), with \(Z=0\) as the reference group. What is the comparison group’s expected-count ratio?
  2. If the reference group’s fitted mean at a profile is 15 and the indicator coefficient is \(\log(0.6)\), calculate the comparison group’s fitted mean and the difference between the two means.
  3. Explain why a negative indicator coefficient does not itself give the expected-count ratio.
  4. A model uses coefficient \(-0.105\), rounded to three decimal places. Should exponentiating it be described as an exact ratio? Explain.
  5. Why can two profiles have the same fitted-mean ratio but different absolute differences between groups?
Clinical Biostats