6.2 Interpretation of the logistic regression coefficients
How do we interpret the logistic regression coefficients? To answer this question, we need to dive into some mathematical details, although, in the end, we will use R to do all the computations for us.
If p is the probability of an event, then p/(1−p) is the “odds” of the event, the ratio of how likely the event is to occur and how likely it is to not occur. The left-hand side of the logistic regression equation ln(p/(1−p)) is the natural logarithm of the odds, also known as the “log-odds” or “logit”. To convert log-odds to odds, apply the inverse of the natural logarithm which is the exponential function ex. To convert log-odds to a probability, apply the inverse logit function ex/(1+ex).
Intercept
Plugging X=0 into Equation (6.1), we find that the intercept β0 is ln(p/(1−p)), the log-odds when all predictors are 0 or at their reference level. Applying the exponential function demonstrates that eβ0 is the corresponding odds of the outcome. Applying the inverse logit function demonstrates that eβ0/(1+eβ0) is the corresponding probability of the outcome.
Predictor coefficients
In linear regression, βk was the difference in the outcome associated with a 1-unit difference in Xk (or between a level and the reference level). Similarly, in logistic regression, it is the difference in the log-odds of the outcome associated with a 1-unit difference in Xk. It turns out that eβk is the odds ratio (OR) comparing individuals who differ by 1-unit in Xk. To see why, start by exponentiating both sides of the logistic regression equation to get the odds as a function of the predictors.
p1−p=eβ0+β1X1+β2X2+…+βKXK
For a continuous predictor X1, the ratio of the odds at X1=x1+1 to the odds at X1=x1 (a one-unit difference) can be expressed as the following ratio, for which all the terms cancel except eβ1.
eβ0+β1(X1+1)+β2X2+…+βKXK/eβ0+β1X1+β2X2+…+βKXK=eβ1
If the first predictor is instead categorical and we want the OR comparing the first non-reference level to the reference level, then we want the ratio of the odds at X1=1 to the odds at X1=0. This is a 1-unit difference, so the derivation above also applies to categorical predictors.
Summary of interpretation of regression coefficients
- The intercept is the log-odds of the outcome when all predictors are at 0 or their reference level. Use the exponential function (eβ0) to convert the intercept to odds and the inverse logit function (eβ0/(1+eβ0)) to convert the intercept to a probability.
- For a continuous predictor, the regression coefficient is the log of the odds ratio comparing individuals who differ in that predictor by one unit, holding the other predictors fixed.
- For a categorical predictor, each regression coefficient is the log of the odds ratio comparing individuals at a given level of the predictor to those at the reference level, holding the other predictors fixed.
- To compute an OR for Xk, exponentiate the corresponding regression coefficient, eβk, thus converting the log of the odds ratio to an OR.
- When there are multiple predictors, ORs are called adjusted ORs (AORs).