i

R Programming Complete Tutorial

Mathematical Computation in R

We will start this section using these two graphs. The first one is the estimated probability of default data using Linear Regression, and they follow the equation p(X) = β0 + β1X. The blue line is the regression line. For balances close to 0, we predict a negative probability, and if we were to predict for large balances, we would get a probability bigger than 1.    

To avoid this problem, we must model p(X) using a function that gives outputs between 0 and 1 for all values of X. In logistic Regression,we use the logistic function:

After a bit of manipulation,we find that:

By taking the logarithm of both sides, we arrive at: