Solved – Converting logistic regression coefficient and confidence interval from log-odds scale to probability scale

logistic

I am trying to figure out whether exp or expit should be used when converting the regression coefficient from logistic regression.

This paper said that:

the exponential function of the regression coefficient (e^b1) is the odds ratio associated with a one-unit increase in the exposure.

While this webpage said that:

We can also transform the log of the odds back to a probability:

$p = \exp(-1.12546)/(1+\exp(-1.12546)) = .245$, if we like.

The webpage used the inverse of logit function (i.e. expit) but not the exponential function for converting the log-odds.

Which one is correct? Or which one is better?

Best Answer

Stating your OP generically:

1. Logistic regression without explanatory variables:

$\color{red}{\text{log}} \,\left[\color{blue}{\text{ODDS(p(Y=1))}}\right]=\color{red}{\text{log}}\left(\frac{\hat p\,(Y=1)}{1-\hat p\,(Y=1)}\right) = \hat\beta_o$

$\hat\beta_o$ is the estimated log odds.

It is an intercept only construct. Exponentiating we get

$$\color{blue}{\text{ODDS(Y=1)}} = \frac{p\,(Y=1)}{1\,-\,p\,(Y=1)} = e^{\,\hat\beta_0}$$

$\color{blue}{\large e^{\hat\beta_o}}$ are the $\color{blue}{\text{ODDS}}$.

Translating into probabilities:

$\color{green}{\Pr(Y = 1)} = \frac{\color{blue}{\text{odds(Y=1)}}}{1\,+\,\color{blue}{\text{odds(Y=1)}}}=\frac{e^{\,\hat\beta_0 }}{1 \,+\,e^{\,\hat\beta_0}}$

This is the second calculation in the OP (i.e. the one containing $-1.12546$).

2. Logistic regression with explanatory variable:

$\color{red}{\text{log}} \,\left[\color{blue}{\text{ODDS(p(Y=1))}}\right]=\color{red}{\text{log}}\left(\frac{\hat p\,(Y=1)}{1-\hat p\,(Y=1)}\right) = \hat\beta_o+\hat\beta_1x_1$

$\color{blue}{\text{ODDS(Y=1)}} = \frac{p\,(Y=1)}{1\,-\,p\,(Y=1)} = e^{\,\hat\beta_0+\hat\beta_1x_1} \tag{*}$

Introducing the odds ratio:

If instead of $x_1$ in $(*)$ we have $x_1+1$ - a one-unit increase:

$$\color{blue}{\text{ODDS(Y=1)}} = \frac{p\,(Y=1)}{1\,-\,p\,(Y=1)} = e^{\,\hat\beta_0+\hat\beta_1x_1+ \hat \beta_1}$$

and

$$\color{green}{\text{ODDS RATIO}} = \frac{\color{blue}{\text{odds|}x_1+1}} {\color{blue}{\text{odds|}x_1}}= \frac{e^{\,\hat\beta_0+\hat\beta_1x_1+ \hat \beta_1}}{e^{\,\hat\beta_0+\hat\beta_1x_1}}= e^{\hat\beta_1}$$

$\color{green}{\large e^{\hat\beta_1}}$ is the $\color{green}{\text{ODDS RATIO}}$.

This is the first calculation in the OP.

For every unit increase in $x_1$ the odds increased by $e^{\hat\beta_1}$.

Hence,

$\color{red}{\log}\,[\color{green}{\text{ODDS RATIO}}] = \hat\beta_1$