Binary Logistic Regression With PASW: Karl L. Wuensch Dept of Psychology East Carolina University
Binary Logistic Regression With PASW: Karl L. Wuensch Dept of Psychology East Carolina University
with PASW
Karl L. Wuensch
Dept of Psychology
East Carolina University
Download the Instructional
Document
• http://core.ecu.edu/psyc/wuenschk/SPSS/
SPSS-MV.htm
.
• Click on Binary Logistic Regression .
• Save to desktop.
• Open in Word.
When to Use Binary Logistic Regression
Yˆ
lnODDS ln a bX
1 Yˆ
• Yˆ is the predicted probability of the event
which is coded with 1 (continue the research)
rather than with 0 (stop the research).
Iterative Maximum Likelihood
Procedure
• PASW starts with arbitrary regression
coefficents.
• Tinkers with the regression coefficients to
find those which best reduce error.
• Converges on final model.
PASW
• Bring the data into PASW
• http://core.ecu.edu/psyc/wuenschk/SPSS/
Logistic.sav
Yˆ
ln ODDS ln .379
1 Yˆ
Exponentiate Both Sides
• Exponentiate both sides of the equation:
• e-.379 = .684 = Exp(B0) = odds of deciding to
continue the research.
Yˆ 128
Exp( .379 ) .684
1 Yˆ 187
Predicted
decision Percentage
Observed stop continue Correct
Step 0 decision stop 187 0 100.0
continue 128 0 .0
Overall Percentage 59.4
a. Constant is included in the model.
b. The cut value is .500
Model Summary
Chi-square df Sig.
Step 1 Step 25.653 1 .000
Block 25.653 1 .000
Model 25.653 1 .000
Variables in the Equation
• ln(odds) = -.847 + 1.217Gender
a bGender
ODDS e
Variables in the Equation
ˆ ODDS 0.429
Y 0.30
1 ODDS 1.429
ˆ ODDS 1.448
Y 0.59
1 ODDS 2.448
Classification
• Decision Rule: If Prob (event) Cutoff,
then predict event will take place.
• By default, PASW uses .5 as Cutoff.
• For every man, Prob(continue) = .59,
predict he will vote to continue.
• For every woman Prob(continue) = .30,
predict she will vote to stop it.
Overall Success Rate
• Look at the Classification Table
Classification Tablea
Predicted
decision Percentage
Observed stop continue Correct
Step 1 decision stop 140 47 74.9
continue 60 68 53.1
Overall Percentage 66.0
a. The cut value is .500
140 68 208
66%
315 315
• PASW beat the Goldfish!
Sensitivity
• P (correct prediction | event did occur)
• P (predict Continue | subject voted to Continue)
• Of all those who voted to continue the research,
for how many did we correctly predict that.
68 68
53%
68 60 128
Specificity
• P (correct prediction | event did not occur)
• P (predict Stop | subject voted to Stop)
• Of all those who voted to stop the research, for
how many did we correctly predict that.
140 140
75%
140 47 187
False Positive Rate
• P (incorrect prediction | predicted occurrence)
• P (subject voted to Stop | we predicted Continue)
• Of all those for whom we predicted a vote to Continue
the research, how often were we wrong.
47 47
41%
47 68 115
False Negative Rate
• P (incorrect prediction | predicted nonoccurrence)
• P (subject voted to Continue | we predicted Stop)
• Of all those for whom we predicted a vote to Stop the
research, how often were we wrong.
60 60
30%
140 60 200
Pearson 2
• Analyze, Descriptive Statistics, Crosstabs
• Gender Rows; Decision Columns
Crosstabs Statistics
• Statistics, Chi-Square, Continue
Crosstabs Cells
• Cells, Observed Counts, Row
Percentages
Crosstabs Output
• Continue, OK
• 59% & 30% match logistic’s predictions.
gender * decision Crosstabulation
decision
stop continue Total
gender Female Count 140 60 200
% within gender 70.0% 30.0% 100.0%
Male Count 47 68 115
% within gender 40.9% 59.1% 100.0%
Total Count 187 128 315
% within gender 59.4% 40.6% 100.0%
Crosstabs Output
• Likelihood Ratio 2 = 25.653, as with
logistic.
Chi-Square Tests
Asymp. Sig.
Value df (2-sided)
Pearson Chi-Square 25.685b 1 .000
Likelihood Ratio 25.653 1 .000
N of Valid Cases 315
a. Computed only for a 2x2 table
b. 0 cells (.0%) have expected count less than 5. The
minimum expected count is 46.73.
Model 2: Decision =
Idealism, Relativism, Gender
• Analyze, Regression, Binary Logistic
• Decision Dependent
• Gender, Idealism, Relatvsm
Covariate(s)
• Click Options and check “Hosmer-
Lemeshow goodness of fit” and “CI for
exp(B) 95%.”
• Continue, OK.
Comparing Nested Models
• With only intercept and gender,
-2LL = 399.913.
• Adding idealism and relativism dropped
-2LL to 346.503, a drop of 53.41.
2(2) = 399.913 – 346.503 = 53.41, p = ?
Model Summary
Score df Sig.
Step Variables gender 25.685 1 .000
0 idealism 47.679 1 .000
relatvsm 7.239 1 .007
cosmetic .003 1 .955
theory 2.933 1 .087
meat .556 1 .456
veterin .013 1 .909
Overall Statistics 77.665 7 .000
Effect of Adding Purpose
• Our previous model had -2LL = 346.503.
• Adding Purpose dropped -2LL to 338.060.
Model Summary
Classification Tablea
Predicted
decision Percentage
Observed stop continue Correct
Step 1 decision stop 152 35 81.3
continue 54 74 57.8
Overall Percentage 71.7
a. The cut value is .500
Answer Key
• Sensitivity = 74/128 = 58%
• Specificity = 152/187 = 81%
• False Positive Rate = 35/109 = 32%
• False Negative Rate = 54/206 = 26%
Wald Chi-Square
• A conservative test of the unique
contribution of each predictor.
• Presented in Variables in the Equation.
• Alternative: drop one predictor from the
model, observe the increase in -2LL, test
via 2.
Variables in the Equation
Guilty
No Yes Total
Plain Attrractive Count 22 8 30
% within Plain 73.3% 26.7% 100.0%
Plain Count 29 1 30
% within Plain 96.7% 3.3% 100.0%
Total Count 51 9 60
% within Plain 85.0% 15.0% 100.0%
a. Delib = Yes
• For those who did not deliberate, the odds
of a guilty verdict are 27/8 when the
defendant was plain and 14/13 when she
was attractive, yielding a conditional odds
ratio of 3.1339.
a
Plain * Guilty Crosstabulation
Guilty
No Yes Total
Plain Attrractive Count 13 14 27
% within Plain 48.1% 51.9% 100.0%
Plain Count 8 27 35
% within Plain 22.9% 77.1% 100.0%
Total Count 21 41 62
% within Plain 33.9% 66.1% 100.0%
a. Delib = No
Interaction Odds Ratio
• The interaction odds ratio is simply the ratio of
these conditional odds ratios – that is, .
09483/3.1339 = 0.030.
• Among those who did not deliberate, the plain
defendant was found guilty significantly more
often than the attractive defendant, 2(1, N = 62)
= 4.353, p = .037.
• Among those who did deliberate, the attractive
defendant was found guilty significantly more
often than the plain defendant, 2(1, N = 60) =
6.405, p = .011.
Interaction Between Continuous
and Dichotomous Predictor
Interaction Falls Short of
Significance
Standardizing Predictors
• Most helpful with continuous predictors.
• Especially when want to compare the
relative contributions of predictors in the
model.
• Also useful when the predictor is
measured in units that are not intrinsically
meaningful.
Predicting Retention in ECU’s
Engineering Program
Practice Your New Skills
• Try the exercises in the handout.