12
Business Intelligence and Decision Modeling Week 11 Predictive Modeling (2) Logistic Regression

Business Intelligence and Decision Modeling Week 11 Predictive Modeling (2) Logistic Regression

Embed Size (px)

Citation preview

Business Intelligence and Decision Modeling

Week 11 Predictive Modeling (2)

Logistic Regression

Regressions Simple 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 Regressionand Functionp = 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 Processe(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 Regressionand Functionp = 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)Z=-10.83 + (.28 x age) +(2.30 x gender)

Where gender=0 Maleet gender =1 Female

If Male 40 years old Z = -10.83+(.28 x 40)+(2.30 x 0)Z = .37 Logite.37 = 1.448 Odds

Thus

p = 1 / 1+e-z p = 1 / 1+e-.37 = .59

orP = odds/(1+odds) p = 1.448/(1+1.448) = .59

Example (2)

Z=-10.83 + .28 x age +2.30 x genderwhere gender=0 MaleAnd gender =1 Female

If Female 40 years old Z = -10.83+(.28 x 40)+(2.30 x 1)Z = 2.67e2.67 = 14.44 Odds

Logitp = 1 / 1+e-z p = 1 / 1+e-2.67 = .94or

P = odds/(1+odds) p = 14.44/(1+14.44) = .93

To Summarize Simple 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