logo

Logistic Regression 📂Statistical Analysis

Logistic Regression

Buildup

Let’s think about performing YX1,,XpY \gets X_{1} , \cdots, X_{p}. Here, YY can be a categorical variable, particularly one with only two classes, such as male and female, success and failure, positive and negative, 00 and 11, etc. For convenience, let’s just call it Y=0Y=0 or Y=1Y=1. In cases where the dependent variable is binary, the interest is ‘what is YY when we look at independent variables X1,Xp X_{1} , \cdots X_{p}’.

However, since YY is a qualitative variable, it cannot be expressed by the linear combination y=β0+β1x1+βpxpy = \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p} of regression coefficients and variables as in ordinary regression analysis. Therefore, we aim to approach it by calculating the probability that it is Y=1Y=1.

Given X=xX=x, let’s set the probability that it is Y=1Y=1 as follows: π:=P(Y=1X=x)=eβ0+β1x1+βpxp1+eβ0+β1x1+βpxp\displaystyle \pi := P ( Y = 1 | X = x ) = {{ e^{ \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p}} } \over { 1+ e^{ \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p}} }}

  • (i) The exponential function is always greater than 00, and since the denominator is greater than the numerator in π\pi, it is 0<π<1 0 < \pi < 1.
  • (ii) Naturally, the probability that it is Y=0Y = 0 is 1π=P(Y=0X=x)=1eβ0+β1x1+βpxp1+eβ0+β1x1+βpxp=11+eβ0+β1x1+βpxp \begin{align*} 1 - \pi =& P ( Y = 0 | X = x ) \\ =& 1 - {{ e^{ \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p}} } \over { 1+ e^{ \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p}} }} \\ =& {{ 1 } \over { 1+ e^{ \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p}} }} \end{align*} and thus π1π=eβ0+β1x1+βpxp1+eβ0+β1x1+βpxp11+eβ0+β1x1+βpxp=eβ0+β1x1+βpxp\displaystyle { { \pi } \over { 1 - \pi } } = { { \displaystyle {{ e^{ \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p}} } \over { 1+ e^{ \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p}} }} } \over { \displaystyle {{ 1 } \over { 1+ e^{ \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p}} }} } } = e^{ \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p}} . Taking the natural log of both sides gives us ln(π1π)=β0+β1x1+βpxp\displaystyle \ln \left( { { \pi } \over { 1 - \pi } } \right) = \beta_{0} + \beta_{1} x_{1} + \cdots \beta_{p} x_{p}.

Taking the log in this way is called a Logit Transformation, and ln(π1π)\displaystyle \ln \left( { { \pi } \over { 1 - \pi } } \right) is referred to as the Logit.

Model 1

A multiple regression analysis ln(π1π)X1,,Xp\displaystyle \ln \left( { { \pi } \over { 1 - \pi } } \right) \gets X_{1} , \cdots, X_{p} that takes the logit as the dependent variable is called Logistic Regression.

By applying the inverse transformation of the logit transformation to the values obtained from the logistic model, we can obtain the original probabilities π\pi we wanted to know. When a coefficient βi\beta_{i} of XiX_{i} is positive, it means that as XiX_{i} increases, the probability of Y=1Y=1 increases, and a negative coefficient means that as XiX_{i} increases, the probability of Y=0Y=0 increases.

Moreover, logistic regression can also be a classification technique by suggesting an appropriate Threshold for the probability, although it is also a prediction technique as it informs the probability of outcomes given certain conditions.

See Also


  1. Hadi. (2006). Regression Analysis by Example(4th Edition): p318~320. ↩︎