Muddy Points

Lesson 6: Interpretations and Visualizations of Odds Ratios

Modified

April 15, 2026

Muddy Points from Spring 2026

1. Interpretations for multilevel categorical explanatory variables - odds ratio? or difference?

The exponential of the coefficients gets us the odds ratio. The coefficients themselves are interpreted as the difference in the log-odds.

2. What would happen if you did not include exponentiate = T in your R code when running logistic regression?

The output would be the coefficients themselves, which are the difference in log-odds. This is not as interpretable as the odds ratio, which is what we get when we exponentiate the coefficients.

3. Can you explain the math for the coefficients in the logistic regression model?

Here’s the setup for our problem. Here’s the logistic regression model for a multilevel categorical variable with 4 levels (a, b, c, d) where a is the reference category:

\[\text{logit}\left(\pi(X) \right) = \beta_0 + \beta_1 \cdot I(X=b) + \beta_2 \cdot I(X=c) + \beta_3 \cdot I(X=d)\]

If we want to interpret \(\beta_2\), we are looking at the difference in log-odds between \(X=c\) and \(X=a\) (the reference category).

We can start with the logistic regression model when \(X=c\):

\[\begin{aligned} \text{logit}\left(\pi(X=c) \right) = & \beta_0 + \beta_1 \cdot I(X=b) + \beta_2 \cdot I(X=c) + \beta_3 \cdot I(X=d) \\ = & \beta_0 + \beta_1 \cdot 0 + \beta_2 \cdot 1 + \beta_3 \cdot 0 \\ = &\beta_0 + \beta_2 \end{aligned}\]

Then we can look at the logistic regression model when \(X=a\):

\[\begin{aligned} \text{logit}\left(\pi(X=a) \right) = & \beta_0 + \beta_1 \cdot I(X=b) + \beta_2 \cdot I(X=c) + \beta_3 \cdot I(X=d) \\ = & \beta_0 + \beta_1 \cdot 0 + \beta_2 \cdot 0 + \beta_3 \cdot 0 \\ = & \beta_0 \end{aligned}\]

So when we take the difference between the logit of the probability for \(X=c\) and \(X=a\), we get \(\beta_2\):

\[\begin{aligned} \text{logit}\left(\pi(X=c)\right) - & \text{logit}\left(\pi(X=a)\right) \\ = & \left( \beta_0 + \beta_1\cdot 0 + \beta_2\cdot 1 + \beta_3\cdot 0 \right) - \left( \beta_0 + \beta_1\cdot 0 + \beta_2\cdot 0 + \beta_3\cdot 0 \right) \\ = & \beta_2 \end{aligned}\]

This means we can interpret \(\beta_2\) as the difference in log-odds between \(X=c\) and \(X=a\). Basically we did all the work up to this point just to assign some meaning to the coefficient \(\beta_2\).

Now we can manipulate the expression to get the odds ratio, which is a more interpretable measure of association.

\[\begin{aligned} \beta_2&=l\mathrm{ogit}\left(\pi(X=c)\right)\ -l\mathrm{ogit}\left(\pi\left(X=a\right)\right) \\ \beta_2&=l\mathrm{og}\left(\dfrac{\pi(X=c)}{1-\pi(X=c)}\right)-l\mathrm{og}\left(\dfrac{\pi\left(X=a\right)}{1-\pi\left(X=a\right)}\right) \\ \beta_2&=\log{\left(\dfrac{\dfrac{\pi(X=c)}{1-\pi(X=c)}}{\dfrac{\pi(X=a)}{1-\pi(X=a)}}\right)} \\ \exp{\left(\beta_2\right)}&=\dfrac{\dfrac{\pi(X=c)}{1-\pi(X=c)}}{\dfrac{\pi(X=a)}{1-\pi(X=a)}} \\ \exp{\left(\beta_2\right)}&=\dfrac{\text{odds}_c}{\text{odds}_a} \\ \exp{\left(\beta_2\right)}&= \text{OR}_{c \text{ vs. } a} \\ \end{aligned}\]

Muddy Points from Spring 2025

1. For “Transformations of continuous variable to make more interpretable,” what does the “c” actually represent?

\(c\) represents any scalar value. Scalar just means it can be a single numerical quantity, so it can be 10, 5, -3, 0.01, etc. If we want to estimate the odds ratio for a 8-year difference in age, then we’ll look at \(c=8\) so that we compare two ages that are 8 years apart.

2. Also, what makes the scale if Logit(pi(x)) linear? Is it because we are changing the values of x itself or is it because we change the scale of our y-axis?

Head back to Lesson 5 on Simple Logistic Regression. We are transforming our outcome (y-axis as you put it) so that we can map \(X\) to \(Y\) only using the parameters (\(\beta\) coefficients). The “linear” part refers to the parameters taking on this intercept and slope that make a line.

Muddy Points from Spring 2024

None?? Wowza!