Business Intelligence and Decision Modeling Week 11 Predictive Modeling (2) Logistic Regression
Regressions Simple Regression Multiple Regression Logistic Regression Y = a + bX + e Multiple Regression Y = a + b1X1 + b2X2 + … + bnXn + e Logistic Regression p = 1 / 1+e-z Z = a + b1X1 + b2X2 + …+ bnXn + e
Logistic Regression and Function p = 1 / 1+e-z Where Logit or z = b0+b1x1+b2x2…+bpxp P=1 P=0 Z -6 -4 -2 0 2 4 6
Outline Logistic Regression Purpose Odds and Logit Interpretation
Logistic Regression Models Logistic regression (binary target) Understand risk factors Assumptions same as linear regression Forecasting Split Samples
Logistic Regression: Odds and Probabilities Dichotomised Response (0/1) Response Probability p Non Response Probability (1-p) Odds = p /(1-p) P = odds/(1+odds)
Probabilities and Odss Probability .10 .20 .30 .40 .50 .60 .70 .80 .90 Odds .11 .25 .43 .67 1.00 1.50 2.33 4.00 9.00 Odds = (p / 1-p) P = odds/(1+odds)
Logistic Regression: Logit Logit Calculation Logit ln(odds) or ln(p/1-p) Inverse Process e(Logit) odds or p/1-p If P = odds/(1+odds) Then p = e(Logit)/1+e(Logit) Or p = 1 / 1+e-Logit
Logistic Regression and Function p = 1 / 1+e-z Where Logit or z = b0+b1x1+b2x2…+bpxp P=1 P=0 Z -6 -4 -2 0 2 4 6
Example (1) Thus Z=-10.83 + (.28 x age) +(2.30 x gender) Where gender=0 Male et gender =1 Female If Male 40 years old Z = -10.83+(.28 x 40)+(2.30 x 0) Z = .37 Logit e.37 = 1.448 Odds Thus p = 1 / 1+e-z p = 1 / 1+e-.37 = .59 or P = odds/(1+odds) p = 1.448/(1+1.448) = .59
Example (2) Z=-10.83 + .28 x age +2.30 x gender If Female 40 years old where gender=0 Male And gender =1 Female If Female 40 years old Z = -10.83+(.28 x 40)+(2.30 x 1) Z = 2.67 e2.67 = 14.44 Odds Logit p = 1 / 1+e-z p = 1 / 1+e-2.67 = .94 or P = odds/(1+odds) p = 14.44/(1+14.44) = .93
To Summarize Simple Regression Multiple Regression Logistic Regression Y = a + bX + e Multiple Regression Y = a + b1X1 + b2X2 + … + bnXn + e Logistic Regression p = 1 / 1+e-z Z = a + b1X1 + b2X2 + …+ bnXn + e