Why Use a Logit Link?
A conditional mean that represents a probability must lie between zero and one. A linear predictor, however, is a weighted sum of predictors and can take any real value. The logit link connects these two scales: it maps a conditional mean strictly between zero and one to a real number, while its inverse maps any finite real number back to a valid conditional mean.
The same transformation has a useful interpretation through odds. If an event has probability \(\mu\), its odds are \(\mu/(1-\mu)\): the probability of the event divided by the probability of its complement. The logit is the natural logarithm of those odds. This representation is useful for bounded conditional means, especially when the response is binary, without by itself specifying a complete statistical model.
In a generalized linear model, write the conditional mean given predictors \(x\) as \(\mu(x)=E[Y\mid x]\). With the logit link, the model relates that mean to a linear predictor \(\eta(x)\) by \(\operatorname{logit}(\mu(x))=\eta(x)\). For example, a linear predictor could be \(\eta(x)=\beta_0+\beta_1x_1+\beta_2x_2\). The logit and inverse-logit equations describe the conversion between \(\mu(x)\) and \(\eta(x)\); they do not, on their own, say how the response is distributed.
If \(Y\mid x\) is Bernoulli with conditional success probability \(p(x)\), then \(E[Y\mid x]=p(x)\), so the conditional mean is a probability. A logit link is also usable for other responses whose conditional mean lies strictly between zero and one. The response distribution must be specified separately. In particular, choosing a logit link does not alone imply that the response is Bernoulli.
From a Mean to Odds and a Logit
To move from a conditional mean to the link scale, first find the complement \(1-\mu\), then divide \(\mu\) by that complement to obtain the odds, and finally take the natural logarithm. Odds are positive for every \(\mu\) strictly between zero and one, so their logarithm is defined. The resulting logit can be positive, negative, or zero.
Worked Example: Converting a Conditional Mean of 0.75
A hypothetical screening outcome has conditional mean \(\mu=0.75\) for a specified predictor profile. Find the odds and the logit predictor. Give the predictor to four decimal places.
Method. Calculate the odds \(\mu/(1-\mu)\), then take their natural logarithm. This avoids confusing the probability itself with the odds.
The complement is \(1-\mu=1-0.75=0.25\). Therefore the odds are $$ \frac{\mu}{1-\mu}=\frac{0.75}{0.25}=3. $$
The odds are \(3:1\): for every one unit of probability assigned to the complement, three units are assigned to the event. The logit predictor is $$ \eta=\log(3)=1.098612\ldots\approx 1.0986. $$
Check. Applying the inverse link gives \(1/(1+\exp(-1.098612\ldots))=1/(1+1/3)=0.75\). The recovered mean agrees with the stated value. A common mistake is to report \(0.75\) as the odds; the odds are \(0.75/0.25=3\), not the probability.
A mean below one-half has odds below one and hence a negative logit. A mean equal to one-half has odds one and logit zero. A mean above one-half has odds greater than one and positive logit. These signs follow directly from comparing \(\mu\) with \(1-\mu\), and can help catch arithmetic or sign errors.
From a Linear Predictor to a Conditional Mean
Given a finite predictor value \(\eta\), use the inverse link to calculate the mean. The exponential \(\exp(\eta)\) is positive, so the ratio \(\exp(\eta)/(1+\exp(\eta))\) is strictly between zero and one. This is why a real-valued predictor can produce a valid conditional mean even when the predictor itself is negative or greater than one.
Worked Example: Applying the Inverse Link to a Predictor
For a hypothetical bounded response, suppose a specified predictor profile gives \(\eta=0.4\). Find the conditional mean and odds, reporting both to four decimal places.
Method. Apply the inverse-logit to obtain the mean. The odds can then be recovered from \(\mu/(1-\mu)\), or directly from \(\exp(\eta)\).
First calculate \(\exp(0.4)=1.4918247\ldots\). Thus $$ \mu=\frac{\exp(0.4)}{1+\exp(0.4)} =\frac{1.4918247\ldots}{2.4918247\ldots} =0.5986877\ldots\approx 0.5987. $$
The odds are $$ \frac{\mu}{1-\mu} =\frac{0.5986877\ldots}{0.4013123\ldots} =1.4918247\ldots\approx 1.4918. $$
Check. Taking the natural logarithm of the unrounded odds gives \(\log(1.4918247\ldots)=0.4\), the original predictor. Do not round the mean before checking: intermediate rounding can make the recovered logit differ slightly from \(0.4\).
When the predictor is built from covariates, the calculation has two distinct stages: evaluate the linear expression first, then apply the inverse link. The linear predictor is not itself the conditional mean. For example, a predictor value of \(-0.2\) is valid, but it cannot be interpreted as a probability; its inverse-logit is a probability between zero and one.
Worked Example: Evaluating a Predictor Before Transforming
A hypothetical model for whether a device passes a diagnostic check uses \(\eta=-2+0.5x_1+0.8x_2\), where \(x_1\) is a recorded operating-load score and \(x_2\) is an indicator equal to one when a specified maintenance step was completed and zero otherwise. For a device with \(x_1=2\) and \(x_2=1\), calculate the predictor, conditional mean, and odds.
Method. Substitute the covariate values into the linear predictor, then use the inverse-logit. The indicator is included as its stated value of one; it is not a probability.
The predictor is $$ \eta=-2+0.5(2)+0.8(1)=-2+1+0.8=-0.2. $$
The odds corresponding to this predictor are \(\exp(-0.2)=0.8187308\ldots\). The conditional mean is $$ \mu=\frac{\exp(-0.2)}{1+\exp(-0.2)} =\frac{0.8187308\ldots}{1.8187308\ldots} =0.4501660\ldots\approx 0.4502. $$
The odds check gives \(\mu/(1-\mu)=0.4501660\ldots/0.5498340\ldots=0.8187308\ldots\), as required. A common mistake is to report \(-0.2\) as the mean because it is the value produced by the linear expression. It is the predictor; transforming it gives the valid conditional mean \(0.4502\).
Why the Inverse Formula Works
The inverse-logit formula follows by solving the defining equation for \(\mu\). This algebra also shows why odds provide the bridge between the two scales.
Let \(\eta=\log\left(\mu/(1-\mu)\right)\), where \(0<\mu<1\).
Exponentiation is the inverse of the natural logarithm, so \(\exp(\eta)=\mu/(1-\mu)\).
Multiply by \(1-\mu\): \(\exp(\eta)(1-\mu)=\mu\). Rearranging gives \(\exp(\eta)=\mu(1+\exp(\eta))\).
Since \(1+\exp(\eta)>0\), \(\mu=\exp(\eta)/(1+\exp(\eta))\), which is the inverse-logit formula.
This derivation gives two useful checks. First, the odds implied by a predictor are \(\exp(\eta)\), because exponentiating the logit returns the odds. Second, for every finite \(\eta\), \(\exp(\eta)>0\), and therefore \(0<\exp(\eta)/(1+\exp(\eta))<1\). The logit is defined only when \(0<\mu<1\); a mean exactly zero or one cannot be inserted into the logarithmic formula. Boundary behavior is a separate issue from converting finite predictor values.
What the Link Does—and Does Not—Specify
The logit link is one way to express a conditional mean on a scale where a linear predictor can range over all real numbers. It does not change the response into a binary variable, and it does not specify the response variance or distribution. Those parts of a generalized linear model must be chosen separately. For a Bernoulli response, the conditional mean is its success probability; for a different bounded response, the mean may have another interpretation.
The odds are a convenient intermediate quantity, not a probability. If \(\mu=0.2\), for example, the odds are \(0.2/0.8=0.25\), or \(1:4\), while the probability remains \(0.2\). Odds greater than one correspond to a probability above one-half; odds less than one correspond to a probability below one-half. This distinction is especially important when the problem asks specifically for a probability, an odds value, or a logit predictor.
Common Exam Traps
- Reversing the odds. The event odds are \(\mu/(1-\mu)\), not \((1-\mu)/\mu\). Reversing the ratio changes the sign of the logit.
- Using the predictor as the mean. A predictor can be negative or greater than one. Transform it with the inverse link before interpreting it as a conditional mean.
- Confusing odds with probability. A probability of \(0.75\) has odds \(3\), not \(0.75\). Keep the requested scale clear throughout the calculation.
- Applying the logit at an endpoint. The expression requires \(0<\mu<1\). Substituting zero or one makes the logarithm undefined.
- Assuming a distribution from the link alone. The link specifies the relationship between the conditional mean and predictor; it does not, by itself, determine the response distribution.
Check Your Understanding
For each problem, keep the probability, odds, and predictor on their distinct scales.
- A hypothetical response has conditional mean \(0.4\) for a specified profile. Find its odds and logit predictor, rounding the predictor to four decimal places. (Answer: odds \(2:3\), or \(2/3\); predictor \(\log(2/3)\approx -0.4055\).)
- A bounded conditional mean has predictor \(\eta=\log(4)\). Use the inverse link to find the mean and state the odds. (Answer: mean \(0.8000\); odds \(4:1\).)
- A hypothetical model has predictor \(\eta=-0.5+0.25x\). At \(x=4\), calculate the predictor and mean, rounding the mean to four decimal places. (Answer: predictor \(0.5\); mean \(1/(1+\exp(-0.5))\approx 0.6225\).)
- A specified event has odds \(5:2\). Find its probability and logit predictor, rounding the probability and predictor to four decimal places. (Answer: probability \(5/7\approx 0.7143\); predictor \(\log(5/2)\approx 0.9163\).)
- A proposed logit model assigns a finite predictor \(\eta=3\) to one profile. Can its implied conditional mean equal \(1.2\)? Explain using the inverse link. (Answer: No; the inverse-logit of any finite predictor is strictly between zero and one, and for \(\eta=3\) the mean is \(1/(1+\exp(-3))\approx 0.9526\).)