310 likes | 517 Views
Logistic Regression. Richard Rivera (aka Rico). Adapted from Scott Yabiku’s Lecture for SOC 507. Overview. Purpose of Logistic Regression Likelihood Probability of an event Odds of an event occurs vs not occuring Odds - Ratio. Why do you need Logistic Regression?.
E N D
Logistic Regression Richard Rivera (aka Rico) Adapted from Scott Yabiku’s Lecture for SOC 507
Overview • Purpose of Logistic Regression • Likelihood • Probability of an event • Odds of an event occurs vs not occuring • Odds - Ratio
Why do you need Logistic Regression? • Predict the likelihood of discrete outcomes • Group membership • Binary outcome (disease/no disease) • Quite Flexible Statistical Assumptions • No assumptions about the distributions of the predictor variables. • Predictors do not have to be normally distributed • Does not have to be linearly related. • Does not have to have equal variance within each group.
Likelihood of Dichotomous Outcomes • Binary dependent variables (0, 1) have two possible outcomes (e.g., success & failure) • Success (y = 1); failure (y = 0). • Goal is to estimate or predict the likelihood of success or failure, conditional on a set of independent variables.
Likelihood of Dichotomous Outcomes • p • Odds • Odds Ratio
What is p? • p = probability (or proportion)
What is p? • p = probability (or proportion) • The lower bound is 0, and the upper bound is 1. • Probability of success: Pr(y = 1) = p • Probability of failure: Pr(y = 0) = 1 – p
What are odds? • Odds are related to probabilities • The odds of an event occuring is the ratio of the probability of that event occurring to the probability of the event not occuring. • Odds of success = p of success divided by p of failure • omega (ω) = p/(1-p)
What are the odds of success? • omega (ω) = p/(1-p) • ω = .75/ (1 - .75) • ω = .75/.25 = 3
What is an odds ratio? • The odds ratio compares the odds of success for one group to another group. • Theta (θ) = ωgroupA = pA/(1-pA) ωgroupB pB/(1-pB)
How can we compare the odds (ω) of males versus females • ωgroupA = pA/(1-pA) • ωgroupB = pB/(1-pB)
How can we compare the odds (ω) of males versus females • ωmale = .67/.33 • ωfemale = .83/.17
How can we compare the odds (ω) of males versus females • ωmale = .67/.33 = 2.03 • ωfemale = .83/.17 = 4.88 • Theta (θ) = ωgroupA / ωgroupB
How can we compare the odds (ω) of males versus females • Theta (θ) = ωgroupA/ ωgroupB • ωmale / ωfemale = 2.03 / 4.88 • ωmale / ωfemale = .4160 • The odds that males succeeds compared to females are only .416 times that of females
How can we compare the odds (ω) of males versus females • How about θ = ωgroupB/ ωgroupA • ωfemale / ωmale = 4.88 / 2.03 = 2.404 • The odds that females succeeds compared to the odds that males succeeds are 2.40 times that of males (or, 2.40 times greater). • Or, you could say the odds for females are 218% greater. • Take the odds ratio and subtract 1.
What is so special about 1 • Take the odds ratio and subtract 1. • What’s so special about 1? 1.00 is the null effect—when the odds ratio is 1.00, there is no difference in the odds for one group relative to the other. • So when we describe odds ratios, we often describe them by how much they differ from 1.00
Why is it called “Logistic” regression? • It uses the logit transformation. • The logistics transformation can be interpreted as the logarithm of the odds of success vs. failure.
What are the odds of favoring gun permits? What are the odds that a male respondent favors gun permits? What is the odds ratio for a male favoring gun permits compared to a female? What is the log odds ratio for a male favoring gun permits compared to a female?
Lets run it in SPSS • 1st, I recommend that you recode any binary variables into new variables with categories 0 and 1. • Transform > Recode > into a different variable • Subsequently: Analyze > Regression > Binary Logistic