Professional Documents
Culture Documents
Session 2.1 Logistic Regression
Session 2.1 Logistic Regression
1
Binary Logistic Regression
Andrew Rogers
andrew.rogers@bristol.ac.uk
1
Move from linear to logistic regression
Probability
P(Y)
0
-5 - - - -4 - - - -3 - - - -2 - - - -1 - - - 0 0. 0. 0. 1 1. 1. 1. 2 2. 2. 2. 3 3. 3. 3. 4 4. 4. 4. 5
4. 4. 4. 3. 3. 3. 2. 2. 2. 1. 1. 1. 0. 0. 0. Z 2 5 7 2 5 7 2 5 7 2 5 7 2 5 7
752 752 752 752 752 5 5 5 5 5 5 5 5 5 5
5 5 5 5 5 5 5 5 5 5
3
The Logistic curve
0.5
Highly likely to be 0
-5 - - - -4 - - - -3 - - - -2 - - - -1 - - - 0 0. 0. 0. 1 1. 1. 1. 2 2. 2. 2. 3 3. 3. 3. 4 4. 4. 4. 5
“0” or e.g. “reject” 4. 4. 4. 3. 3. 3. 2. 2. 2. 1. 1. 1. 0. 0. 0. Z 2 5 7 2 5 7 2 5 7 2 5 7 2 5 7
752 752 752 752 752 5 5 5 5 5 5 5 5 5 5
5 5 5 5 5 5 5 5 5 5
“Grey area”. Less
confident these are
“0” or “1”
4
Model estimation
Step1
OR
Step2
Step3 (
Step5
−2𝐿𝐿=−2× ∑ 𝐿𝑜𝑔(𝐿)
The aim is to selecting model coefficients () to minimise the -2LL
5
Model diagnostics
6
Assumptions of logistic regression
• Assumptions
• Logit format not linear. Assumption that there is a linear relationship
between the predictors and the logit form.
• i.e. the z= a +bX model and the logistic curve
• Errors are independent (as per linear regression)
• Multicollinearity should be avoided (as per linear regression)
• Issues
• Incomplete predictors - not sufficient combination of independent
variables to build a viable prediction model.
• (if trying to predict brand choice based on age/gender and there was no data referring to
younger male choices)
• Complete separation – if the dependent variable can be predicted exactly
by a linear combination of the independent variables
Explore the data set loan_data.sav
9
• Load the variables into the logistic regression
(Analyze/Regression/Binary logistic).
• Click categorical and identify which variables are categorical (nominal)
10
• Select the iteration history option to assess the change in Log
Likelihood
11
• The algorithm start with
“Block 0”.
• All classifications on one group
Block 0 Block 1
Difference
(constant only model) (Full model)
13
• The classification table is very useful to understand how may of
the observations are categorised correctly.
• Also for those not classified correctly, what (if any) is the
systematic error.
• The risk in this analysis is accepting a high number of applications who
have defaulted, thinking they have not defaulted.
14
Ration of the B estimate to the Odds ratio (Odds of “1” vs
S.E. Large values mean more odds of “0”. Also the Exp of
confidence in the Be estimate Sig level of the B. B. Exp(B) >1 means the odds
Coefficient of the X
(similar to t-ratio in linear) (<.05 desirable) of the outcome occurring
variable in model Z. The
change in Z given a one increases. Exp(B)<1 the less
unit change in X likely.
15