# log(odds) to p formulation

$$Log(Odds) = log({p \over (1-p)})$$

$${p \over (1-p)} = e^{b+b_1x_1+....}$$

I understand up to here, however how does this:

$$p = (1-p) e^{b+b_1x_1+...}$$

become:

$$p = {1 \over {1+e^{-(b+b_1x_1+...)}}}$$

Can someone explain last two steps?

We have, $$p = (1 - p)e^{b + b_1x_1 + \ldots}$$

Let $$y= {b + b_1x_1 + \ldots}$$

So, $$p = (1 - p)e^y$$

or, $$p = e^y - pe^y$$

or, $$p+pe^y = e^y$$

or, $$p(1+e^y) = e^y$$

or, $$p = e^y/(1+e^y)$$

or, $$p = 1/(e^{-y}+1)$$ (Dividing both denominator and numerator by $$e^y$$ on the RHS)

or, $$p = 1/(e^{-{b + b_1x_1 + \ldots}}+1)$$

or, $$p = 1/(1+e^{-{b + b_1x_1 + \ldots}})$$

Let me know if you have any doubts.

• How do we get $p(1-e^{y})$ ? as @Linxing Yao derived on RHS? Oct 18 at 9:58
• That should be $p(1+e^y)$. I think he has made a silly mistake there. Did you understand my answer @haneulkim? Oct 18 at 10:04
• Yes, this is perfect. Thanks :) Oct 19 at 0:54

$$p = (1 - p)e^{b + b_1x_1 + \ldots}$$, then $$p(1 + e^{b + b_1x_1 + \ldots}) = e^{b + b_1x_1 + \ldots}$$, thus \begin{align} p &= \frac{e^{b + b_1x_1 + \ldots}}{1 + e^{b + b_1x_1 + \ldots}} \\ &= \frac{1}{1 + e^{-(b + b_1x_1 + \ldots)}} \end{align}

• could you elaborate formula between then and thus? Oct 18 at 3:48
• you can move the same factor p to the left side, it transits my first equation to the my second equation. Oct 18 at 4:53
• let $y = b+b_1x_1+...$I'm confused about how $p = (1-p)e^{y}$ becomes $p(1-e^{y}) = e^{y}$. Oct 18 at 5:55