# Logistic Regression and modelling probabiliy $\pi$

This is a General Linear Models topic but I believe it's just basic failure to remember some more basic math rules that's making it difficult for me.

$$g(\pi) = \log(\frac{\pi}{1-\pi}) = x^T\beta$$

show that this is equivalent to modeling the probability $$\pi$$ as,

$$\pi = \frac{e^{x^T}\beta}{1+e^{x^T}\beta}$$

Again I think this is a simply inverse. But I'm not quite sure how to do it.

You're right, it is just the inverse

$$\ln\frac{\pi}{1 - \pi} = x^T\beta ~~~\Rightarrow~~~ \frac{\pi}{1 - \pi} = e^{x^T\beta} ~~~\Rightarrow~~~ \pi = (1 - \pi)e^{x^T\beta} = e^{x^T\beta} - \pi e^{x^T\beta}$$

Now rearrange a bit things

$$\pi (1 + e^{x^T\beta}) = e^{x^T\beta}$$

and from here

$$\pi = \frac{e^{x^T\beta}}{1 + e^{x^T\beta}}$$

• Thank you kindly! I'm not sure why I kept stopping myself at the part where we multiply the exponential by $(1-\pi)$. I appreciate your time! – Nicklovn Feb 4 at 19:24
• @Nicklovn Happy to help – caverac Feb 4 at 19:25