Tutorials › Generalized Linear Models › How Link Choice Changes Mean Curves

Link Functions and Scale · Tutorial 115 of 981

How Link Choice Changes Mean Curves

Compare how identity, log, and logit inverse links transform the same straight-line predictor into distinct mean curves and covariate effects.

Beginner 9 min read

What You'll Learn

  • Write the mean curve for identity, log, and logit inverse links using one shared linear predictor
  • Compare the ranges of the resulting mean curves and identify when an identity-link curve leaves the unit interval
  • Derive each curve’s slope and curvature with respect to a continuous covariate
  • Locate the logistic mean curve’s inflection point and explain how its slope changes
  • Distinguish constant additive effects from multiplicative mean effects and constant odds ratios
  • Calculate and compare predictions for specified covariate values and link choices

One Straight Predictor, Three Mean Curves

A generalized linear model uses a linear predictor, but the mean response need not be linear in a covariate. The inverse link transforms that predictor into the mean. Consequently, holding the predictor fixed while changing only the inverse link can produce curves with different shapes, ranges, and covariate effects. This comparison is useful when deciding what a model says about changes in the mean, not just how its coefficients look on the predictor scale.

Let \(x\) be a continuous covariate and use the same linear predictor for all three links: \(\eta(x)=\beta_0+\beta_1x\). Here \(\beta_0\) and \(\beta_1\) are fixed coefficients. We compare identity, log, and logit inverse links. For the logit, write \(p(x)\) for the resulting mean.

Definition: For a fixed linear predictor \(\eta(x)=\beta_0+\beta_1x\), the identity-link mean curve is \(\mu_I(x)=\eta(x)\), the log-link mean curve is \(\mu_L(x)=\exp\{\eta(x)\}\), and the logit-link mean curve is \(\mu_G(x)=\exp\{\eta(x)\}/[1+\exp\{\eta(x)\}]\). These are different transformations of the same predictor, not three different linear predictors.

The identity curve is a straight line, the log-link curve is exponential in \(x\), and the logit-link curve is an S-shaped curve. These shape descriptions concern the mean as a function of \(x\); the predictor itself remains a straight line. The links have different allowable mean ranges: the identity inverse link can take any real value, the log inverse link is positive, and the logit inverse link lies strictly between zero and one.

Worked Comparison at Specific Covariate Values

Worked Example: Three Curves From One Predictor

Take \(\eta(x)=-1+0.5x\), and compare predictions at \(x=0,2,4\). The predictor values are \(-1,0,1\), respectively.

For the identity link, the mean equals the predictor: \(\mu_I(0)=-1\), \(\mu_I(2)=0\), and \(\mu_I(4)=1\).

For the log link, exponentiate each predictor value: \(\mu_L(0)=e^{-1}\approx0.368\), \(\mu_L(2)=e^0=1\), and \(\mu_L(4)=e^1\approx2.718\).

For the logit link, apply \(p=e^\eta/(1+e^\eta)\): \(p(0)=e^{-1}/(1+e^{-1})\approx0.269\), \(p(2)=1/(1+1)=0.5\), and \(p(4)=e/(1+e)\approx0.731\).

All three have the same predictor values and increase with \(x\), since \(\beta_1=0.5>0\). Their means are nevertheless very different. In particular, the identity curve gives negative and zero values at the first two points, so it would be unsuitable if the response mean must be a probability or a strictly positive quantity. The log and logit curves respect positive and unit-interval ranges, respectively.

Deriving Slope and Curvature

The first derivative of a mean curve describes its local rate of change per unit increase in \(x\). The second derivative describes how that rate itself changes. These derivatives make precise the differences suggested by the curve shapes. The following calculations assume \(x\) is continuous and \(\beta_0,\beta_1\) are fixed.

Result: For the three mean curves, the slopes are \(\beta_1\), \(\beta_1\mu_L(x)\), and \(\beta_1p(x)[1-p(x)]\), respectively. Their second derivatives are \(0\), \(\beta_1^2\mu_L(x)\), and \(\beta_1^2p(x)[1-p(x)][1-2p(x)]\), respectively.

For the identity link, differentiating \(\mu_I(x)=\beta_0+\beta_1x\) gives \(\mu_I'(x)=\beta_1\), and differentiating again gives \(\mu_I''(x)=0\).

For the log link, \(\mu_L(x)=\exp(\beta_0+\beta_1x)\). The chain rule gives \(\mu_L'(x)=\beta_1\exp(\beta_0+\beta_1x)=\beta_1\mu_L(x)\). Differentiating this expression once more gives \(\mu_L''(x)=\beta_1^2\mu_L(x)\). Since \(\mu_L(x)>0\), the curve is strictly convex when \(\beta_1\ne0\), and is constant when \(\beta_1=0\).

For the logit link, let \(p(x)=e^{\eta(x)}/[1+e^{\eta(x)}]\). Differentiating with respect to \(\eta\) yields \(dp/d\eta=p(1-p)\), while \(d\eta/dx=\beta_1\). Thus \(p'(x)=\beta_1p(1-p)\). Differentiating again and applying the product rule gives \(p''(x)=\beta_1^2p(1-p)(1-2p)\).

Because \(0<p<1\), the sign of the logistic curve’s curvature is the sign of \(1-2p\), provided \(\beta_1\ne0\). Its curvature is positive where \(p<1/2\), zero where \(p=1/2\), and negative where \(p>1/2\). Since \(p=1/2\) exactly when \(\eta=0\), the curve changes curvature at the predictor value zero. If \(\beta_1\ne0\), this occurs at \(x=-\beta_0/\beta_1\). If \(\beta_1=0\), all three curves are constant and there is no covariate-driven curvature.

The slope formulas also show how quickly the means change. For a positive \(\beta_1\), the identity slope is constant, while the log-link slope grows with its mean. The logistic slope is positive but depends on \(p\); its magnitude is largest at \(p=1/2\), because \(p(1-p)=1/4-(p-1/2)^2\leq1/4\). Thus its maximum absolute slope is \(|\beta_1|/4\), attained at \(\eta=0\).

Covariate Changes: Additive, Multiplicative, and Odds-Scale

A slope is a local effect. For a finite covariate change \(\Delta\), each link also gives a useful exact comparison. The identity link makes the mean difference constant. The log link makes the ratio of means constant. The logit link makes the odds ratio constant. These statements follow directly from the shared linear predictor.

Result: For any \(x\) and any real \(\Delta\), the identity-link mean difference is \(\mu_I(x+\Delta)-\mu_I(x)=\beta_1\Delta\). The log-link mean ratio is \(\mu_L(x+\Delta)/\mu_L(x)=\exp(\beta_1\Delta)\). For the logit-link mean, the odds \(p(x)/[1-p(x)]\) have ratio \(\exp(\beta_1\Delta)\) between \(x+\Delta\) and \(x\).

For the identity link, substitution gives \(\mu_I(x+\Delta)=\beta_0+\beta_1(x+\Delta)\). Subtracting \(\mu_I(x)=\beta_0+\beta_1x\) leaves \(\beta_1\Delta\). For the log link, the ratio is \(\exp\{\beta_0+\beta_1(x+\Delta)\}/\exp\{\beta_0+\beta_1x\}=\exp(\beta_1\Delta)\).

For the logit link, the odds are \(p(x)/[1-p(x)]=\exp\{\eta(x)\}\), by substituting the logistic expression for \(p(x)\). Therefore the odds ratio is \(\exp\{\eta(x+\Delta)-\eta(x)\}=\exp(\beta_1\Delta)\). This is a constant odds ratio, not a constant difference in probabilities: the probability difference generally depends on the starting value of \(p(x)\).

Worked Example: Comparing a Two-Unit Covariate Increase

Let \(\eta(x)=0.2+0.3x\), and compare \(x=0\) with \(x=2\). Here \(\Delta=2\), so the predictor increases by \(\beta_1\Delta=0.3(2)=0.6\).

Under the identity link, the mean increases by exactly \(0.6\), from \(\mu_I(0)=0.2\) to \(\mu_I(2)=0.8\).

Under the log link, the mean at \(x=0\) is \(e^{0.2}\approx1.221\), and at \(x=2\) it is \(e^{0.8}\approx2.226\). The ratio is \(e^{0.8}/e^{0.2}=e^{0.6}\approx1.822\). Thus the mean is about 1.822 times as large, an increase of about 82.2%.

Under the logit link, \(p(0)=e^{0.2}/(1+e^{0.2})\approx0.550\), and \(p(2)=e^{0.8}/(1+e^{0.8})\approx0.690\). The odds ratio is \(e^{0.6}\approx1.822\), as for the log-link mean ratio, but the probability difference is approximately \(0.690-0.550=0.140\). A probability increase of 0.140 is not a constant effect implied at every starting probability.

Worked Example: Logistic Slope and Curvature

Consider \(\eta(x)=-2+x\), so \(\beta_1=1\). At \(x=1\), \(\eta=-1\) and \(p=1/(1+e)\approx0.269\). The slope is \(p(1-p)\approx0.269(0.731)=0.197\), and the curvature is \(p(1-p)(1-2p)\approx0.197(0.462)=0.091\), which is positive.

At \(x=2\), \(\eta=0\) and \(p=0.5\). The slope is \(0.5(0.5)=0.25\), its maximum for this coefficient, and the curvature is \(0.25(1-1)=0\).

At \(x=3\), \(\eta=1\) and \(p=e/(1+e)\approx0.731\). The slope is \(0.731(0.269)\approx0.197\), while curvature is \(0.197(1-1.462)\approx-0.091\). The slope remains positive, but is now decreasing. The curve is increasing throughout, changing from convex to concave at \(x=2\).

Reading the Comparison Carefully

Inverse linkMean curve and rangeEffect of a covariate increase \(\Delta\)Curvature when \(\beta_1\ne0\)
IdentityStraight line; any real meanMean difference \(\beta_1\Delta\)Zero everywhere
LogExponential curve; positive meanMean ratio \(\exp(\beta_1\Delta)\)Positive everywhere
LogitS-shaped curve; mean strictly between zero and oneOdds ratio \(\exp(\beta_1\Delta)\)Positive below mean \(1/2\), zero at \(1/2\), negative above \(1/2\)

The table concerns the mathematical consequences of each inverse link for a given predictor. It does not by itself establish that a particular link is appropriate for a response: the response’s support and the model’s purpose matter too. For example, a probability mean must be in \([0,1]\), whereas the identity inverse link is unrestricted. The logit inverse link produces values strictly inside that interval for finite predictors; it does not produce exact boundary values at finite \(x\).

Common mistake: “The coefficient \(\beta_1\) is 0.3, so a two-unit increase in \(x\) raises the mean by 0.6 for any link.” This is correct for the identity link, because it gives a mean difference. It is not the log-link interpretation: there, the mean is multiplied by \(e^{0.6}\). Nor is it the logit-link interpretation: there, the odds are multiplied by \(e^{0.6}\), while the probability difference depends on the starting probability. Always identify the scale on which the change is constant.

Key takeaway: With the same straight-line predictor, the inverse link determines the mean curve’s shape and range as well as the scale of a covariate effect. Identity gives a constant additive mean change, log gives a constant mean ratio, and logit gives a constant odds ratio.

Check Your Understanding

Use the formulas and comparisons above to answer these questions.

  1. For \(\eta(x)=1-0.4x\), write the identity-, log-, and logit-link mean curves.
  2. If \(\beta_1<0\), what is the direction of change in each of the three mean curves as \(x\) increases?
  3. For the logit-link curve, where does its curvature change sign, and what is its slope there?
  4. Under a log link, what is the mean ratio for an increase \(\Delta\) in \(x\)? Why is that not a mean difference?
  5. Explain why a logit-link odds ratio can remain constant while the probability difference changes with the starting probability.
Clinical Biostats