Tutorials › Generalized Linear Models › Building a Marginal Linear Predictor

Marginal Mean Models · Tutorial 823 of 981

Building a Marginal Linear Predictor

Construct a marginal linear predictor from a scientific question, then interpret its coefficients on the link scale and, when appropriate, the response scale.

Advanced 11 min read

What You'll Learn

  • Write a marginal mean model using cluster and measurement indices
  • Distinguish the marginal linear predictor from the response mean
  • Choose reference categories and units that make coefficients interpretable
  • Translate scientific questions into additive predictor formulas
  • Interpret intercepts and slopes on the link scale
  • Understand how centering a covariate changes the intercept but not the fitted means

From a Scientific Question to a Mean Formula

A marginal model begins with a question about the average response at specified covariate values. The model formula should make clear which covariates explain that mean, how they enter, and on what scale their contributions are additive. This is a matter of specifying the mean structure; it is separate from specifying how responses within the same cluster are associated.

Write \(Y_{ij}\) for the response from cluster \(i\) at measurement \(j\), where \(i=1,\ldots,m\) and \(j=1,\ldots,n_i\). Let \(X_i\) denote the covariates recorded for cluster \(i\), and let \(x_{ij}\) be the covariate values relevant to \(Y_{ij}\). The marginal mean for that response is

$$ \mu_{ij}=E[Y_{ij}\mid X_i]. $$

This conditions on the observed covariates, not on the other responses in the cluster. In a marginal model, the mean is not defined by conditioning on a latent subject effect. The link function \(g\) maps the response mean to a scale on which a linear predictor is specified.

Definition: A marginal linear predictor is a linear combination of specified covariate terms, usually written \(\eta_{ij}=x_{ij}^{\mathsf T}\beta\). A marginal mean model relates it to the response mean by \(g(\mu_{ij})=\eta_{ij}\), or equivalently \(\mu_{ij}=g^{-1}(\eta_{ij})\) when the inverse link is defined. The vector \(\beta\) contains the model coefficients; the entries of \(x_{ij}\) encode the intercept and covariate terms.

The word “linear” refers to linearity in the coefficients, not necessarily to the response mean itself. For example, a log link gives a mean that is an exponential function of the predictor. The predictor can include transformed covariates, such as age squared, while remaining linear in its coefficients.

Building the Predictor Deliberately

Start by stating the scientific question in terms of a mean. Then decide which covariates represent the comparison or trend of interest. For a basic additive model, each covariate contributes its own term, and the predictor can be written as an intercept plus those terms. The intercept is the predictor value when every numeric covariate is zero and every categorical covariate is at its reference category. Whether that point is scientifically useful depends on the coding.

For a categorical covariate, choose a reference category and represent the remaining categories with indicator variables. For a numeric covariate, state its units and consider centering it at a meaningful value. These choices do not change the underlying fitted means when the model is reparameterized appropriately, but they do change what the intercept describes.

1
Name the mean being modeled.
Specify the response and the covariate information on which its marginal mean is conditioned.
2
Translate the question into terms.
Identify the covariates, their units, and any reference category. Decide which contributions are additive on the link scale.
3
Write the link-scale equation.
Set \(g(\mu_{ij})\) equal to the intercept plus the chosen covariate terms, and define any indicator variables.
4
Interpret the coefficients at their coded values.
State what the intercept and each coefficient changes on the link scale; translate to the response scale when the link permits a clear interpretation.

This process prevents a common ambiguity: a coefficient has meaning only in relation to the covariate coding and the other terms in the predictor. In particular, an intercept is not automatically the overall sample mean, and a slope is not automatically a constant difference in response means.

Worked Example: Treatment and Centered Age

Suppose a study records repeated clinical responses for each participant and asks whether the marginal mean response differs by treatment, adjusting additively for age. Let \(A_{ij}=1\) for active treatment and \(A_{ij}=0\) for control, and let \(a_{ij}\) be age in years. Use the logit link and center age at 50:

$$ \operatorname{logit}(\mu_{ij}) =\log\!\left(\frac{\mu_{ij}}{1-\mu_{ij}}\right) =\beta_0+\beta_A A_{ij}+\beta_a(a_{ij}-50). $$

For illustration, take \(\beta_0=-1.2\), \(\beta_A=0.6\), and \(\beta_a=0.03\). At age 50 in the control group, the predictor is \(-1.2\), so the mean is

$$ \mu=\frac{e^{-1.2}}{1+e^{-1.2}} =\frac{0.3010}{1.3010}\approx 0.231. $$

At age 50 in the active-treatment group, the predictor is \(-1.2+0.6=-0.6\), giving \(\mu=e^{-0.6}/(1+e^{-0.6})=0.5488/1.5488\approx0.354\). The intercept is the control-group log odds at age 50. The treatment coefficient is a difference of \(0.6\) in log odds at a fixed age; its corresponding odds ratio is \(e^{0.6}\approx1.822\). The age coefficient is \(0.03\) in log odds per year at fixed treatment, corresponding to a multiplicative odds change of \(e^{0.03}\approx1.030\) per year. Because this specified predictor has no treatment-by-age term, that log-odds difference does not vary with age.

Worked Example: A Three-Category Exposure

Suppose the marginal mean of a clinical score is modeled on the identity-link scale by study arm, with arm A as the reference. Let \(B_{ij}=1\) if the response is from arm B and \(C_{ij}=1\) if it is from arm C; both indicators are zero in arm A. The predictor is

$$ \mu_{ij}=\beta_0+\beta_B B_{ij}+\beta_C C_{ij}. $$

With \(\beta_0=12\), \(\beta_B=-2.5\), and \(\beta_C=-1.0\), the modeled marginal means are \(12\) in arm A, \(12-2.5=9.5\) in arm B, and \(12-1.0=11\) in arm C. The coefficient \(\beta_B\) is the arm B minus arm A mean difference, and \(\beta_C\) is the arm C minus arm A mean difference under this identity-link model. The indicator definitions matter: if a different arm were chosen as the reference, the intercept and coefficients would be expressed differently.

What Additivity Implies

In an additive predictor, changing one covariate while holding the others fixed changes the predictor by a quantity determined by that covariate’s term. This is the basic algebra behind coefficient interpretations. The result concerns the link scale; the corresponding change in the response mean depends on the inverse link.

Theorem: Suppose \(g(\mu_{ij})=\beta_0+\beta_k z_{k,ij}+\sum_{r\ne k}\beta_r z_{r,ij}\), with the same coefficient \(\beta_k\) throughout the specified model. If \(z_{k,ij}\) changes by \(\Delta\) while all other terms are held fixed, then \(g(\mu_{ij})\) changes by \(\beta_k\Delta\). If \(g\) is one-to-one on the relevant mean range, the new mean is \(g^{-1}(g(\mu_{ij})+\beta_k\Delta)\).

Proof. Write \(\eta\) for the original predictor. After changing \(z_{k,ij}\) to \(z_{k,ij}+\Delta\), the new predictor is

$$ \eta_{\mathrm{new}} =\beta_0+\beta_k(z_{k,ij}+\Delta) +\sum_{r\ne k}\beta_r z_{r,ij} =\eta+\beta_k\Delta. $$

Since \(g(\mu_{ij})=\eta\), the link-scale change is \(\eta_{\mathrm{new}}-\eta=\beta_k\Delta\). Applying the inverse link gives the stated mean. \(\square\)

For a factor indicator, the same reasoning gives the coefficient as the change in the predictor from the reference category to that category, holding other terms fixed. Under a log link, a one-unit increase in a numeric covariate multiplies the mean by \(e^{\beta_k}\), because \(g^{-1}(\eta)=e^\eta\). Under an identity link, it changes the mean by \(\beta_k\). These response-scale translations depend on the link, not merely on the word “slope.”

Worked Example: A Log-Link Predictor

For a positive repeated-measure outcome, suppose the marginal mean has the log-link predictor

$$ \log(\mu_{ij})=\beta_0+\beta_x(x_{ij}-4). $$

Let \(\beta_0=\log(20)\) and \(\beta_x=-0.08\), with \(x\) measured in stated exposure units. At \(x=4\), \(\log(\mu)=\log(20)\), so \(\mu=20\). At \(x=7\),

$$ \mu=\exp\{\log(20)-0.08(7-4)\} =20e^{-0.24}\approx20(0.7866)=15.73. $$

A one-unit increase in \(x\) multiplies the modeled mean by \(e^{-0.08}\approx0.923\), a decrease of about \(7.7\%\) per unit. The coefficient itself is a change in log mean, not a decrease of \(0.08\) outcome units.

Centering and the Meaning of the Intercept

Centering a numeric covariate replaces its zero point with a chosen reference value. This often makes the intercept interpretable without changing the model’s fitted means or slope. The algebra is exact, provided the same additive terms are retained.

Theorem: In the predictor \(\eta=\beta_0+\beta_x x\), let \(c\) be a fixed constant and define \(x_c=x-c\). The identical predictor can be written \(\eta=\beta_{0,c}+\beta_x x_c\), where \(\beta_{0,c}=\beta_0+\beta_x c\). Thus centering changes the intercept to the predictor at \(x=c\), leaves the slope unchanged, and leaves every fitted mean unchanged.

Proof. Since \(x=x_c+c\), substitution gives

$$ \eta=\beta_0+\beta_x(x_c+c) =(\beta_0+\beta_xc)+\beta_xx_c. $$

Setting \(\beta_{0,c}=\beta_0+\beta_xc\) yields the centered expression. Both expressions equal the same \(\eta\) for each value of \(x\), so applying the same inverse link produces the same fitted mean. The coefficient of \(x_c\) remains \(\beta_x\), while the new intercept is the predictor at \(x_c=0\), equivalently \(x=c\). \(\square\)

In a model with several additive terms, the same substitution applies to one numeric covariate while the other terms remain unchanged. With categorical indicators, the intercept also depends on which category is assigned all-zero indicators. It is therefore good practice to describe the intercept using the reference values explicitly, rather than simply calling it the “baseline.”

Common Mistakes and a Practical Check

  • Calling the predictor the mean. The predictor is \(\eta=g(\mu)\); obtain the response mean by applying the inverse link.
  • Interpreting an intercept at an impossible value. If age is measured from zero, an intercept may refer to age zero. Centering at a meaningful age gives it a more useful reference point.
  • Reading a link-scale coefficient as an outcome-unit difference. That is valid for the identity link, but not in general. Translate with \(g^{-1}\) when a response-scale interpretation is needed.
  • Leaving factor coding implicit. State the reference category and define each indicator, or the intercept and factor coefficients are ambiguous.
  • Assuming separate coefficient estimates are identifiable from any design. If predictor columns are redundant, different coefficient vectors can produce the same linear predictor. Check that the design contains enough distinct covariate patterns to distinguish the terms being interpreted.

A useful final check is to select a particular covariate pattern, substitute its values into the predictor, and verify that the resulting intercept and terms represent the comparison intended by the scientific question. This calculation often reveals a misplaced reference value or an indicator coded in the wrong direction before any fitting is attempted.

Key takeaway: A marginal linear predictor is built by expressing the scientific comparison as covariate terms on the link scale. The link, units, centering, and reference-category coding together determine what its coefficients mean.

Check Your Understanding

For each question, identify the predictor structure or interpretation that is appropriate.

  1. In a logit-link model with a treatment indicator and age centered at 60, what covariate pattern does the intercept describe?
  2. For an identity-link additive model, what response-scale change corresponds to increasing a numeric covariate by two units?
  3. In a three-category factor coded with category A as the reference, what does the coefficient for category C represent on the link scale?
  4. For a log-link model with slope \(\beta_x=0.12\), what multiplicative change in the mean corresponds to a one-unit increase in \(x\)?
  5. Show how the intercept changes when \(x\) is replaced by \(x_c=x-5\) in \(\eta=\beta_0+\beta_xx\), and state what the new intercept represents.
Clinical Biostats