1/40
Looks like no tags are added yet.
Why use logistic regression?
The DV is categorical (binary, multinomial, or ordinal) rather than continuous
Binary vs. multinomial vs. ordinal logistic regression
Binary: 2 outcomes (quit / didn't). Multinomial: 3+ unordered categories. Ordinal: 3+ ordered categories (e.g., Likert ratings).
Problem 1 with linear regression on a binary DV
Predicted values can fall below 0 or above 1, which are impossible probabilities
Two linear regression assumptions a binary DV violates
Normality of Y (Y is only 0 or 1) and constant variance (variance of a binary variable is p(1 - p), which changes with X)
Odds formula
p / (1 - p)
Odds for a 75% probability
.75 / .25 = 3 (3 to 1)
Range of odds
0 to +infinity
Odds = 1, > 1, < 1 means…
= 1: 50/50. > 1: event more likely than not. < 1: event less likely than not.
Logit
The natural log of the odds: ln[p / (1 - p)]
Range of the logit
-infinity to +infinity
Logit = 0, > 0, < 0 means…
= 0: p = .50. > 0: p > .50. < 0: p < .50.
Why predict the logit instead of p?
The logit is unbounded, so a straight-line equation can predict it without going outside possible values
Logarithm vs. exponentiation
They are inverses: log returns the exponent; exponentiation (e^x) undoes the log
Natural log base
e (approx. 2.718)
Logistic regression equation (logit form)
ln[p / (1 - p)] = b0 + b1X
Logistic regression equation (probability form)
p = 1 / (1 + e^-(b0 + b1X)), also written e^z / (1 + e^z)
Shape of the logistic function
S-shaped (sigmoid) curve bounded between 0 and 1
How are logistic regression weights estimated?
Maximum likelihood (minimizing the negative log-likelihood), not least squares
Logistic regression coefficient (b) means…
The change in the log odds (logit) of Y = 1 for a 1-unit increase in X; also the log of the odds ratio
Odds ratio (OR)
e^b: the factor by which the odds of Y = 1 are multiplied for a 1-unit increase in X; a ratio of two odds
Sign of b and size of OR
b > 0
Logit vs. odds ratio vs. coefficient
Logit = log of one odds. OR = ratio of two odds. Coefficient = log of the OR = difference between two logits.
Deck engagement example: b = 0.303. Odds ratio?
e^0.303 = 1.35: each 1-point increase in engagement multiplies the odds of retention by 1.35 (35% higher odds)
Converting an OR to a percent change in odds
(OR - 1) x 100. OR = .893 -> 10.7% lower odds; OR = 1.108 -> 10.8% higher odds
Wald statistic
Tests H0: b = 0 for one predictor (like a t-test); biased when b is large
Better alternative to the Wald test
Compare nested models with a likelihood-ratio (chi-square) test, adding one predictor at a time
Log-likelihood (LL)
Like the residual SS in linear regression: how much is unexplained after fitting; smaller -2LL (deviance) = better fit
Comparing two logistic models
The difference in their deviances (-2LL) is a chi-square with df = difference in number of predictors
Deck: null deviance 690.83, residual deviance 352.50
Drop of 338.3 on 1 df: engagement greatly improves fit
Hosmer-Lemeshow (HL) test
Overall goodness-of-fit test: groups cases (8-12 groups, often deciles) by predicted probability and compares observed vs. expected counts with chi-square
Interpreting the HL p-value
Small p (< .05) = poor fit. Large p (> .05) = good fit. (Opposite of most tests.)
Weaknesses of the HL test
Low power (esp. n < 30), ignores overfitting, arbitrary number of groups, results change with small changes in grouping
Multinomial logistic regression
For 3+ unordered DV categories; fits k - 1 binary models, each comparing one category to a reference category, each with its own intercept and coefficients
Relative risk ratio (RRR)
e^b in multinomial regression: how the odds of being in category k vs. the reference change per 1-unit increase in X
Multinomial deck example: IQ coefficient -0.113 for vocational vs. academic
Each extra IQ point lowers the odds of vocational vs. academic; OR = e^-0.113 = .893
Ordinal logistic regression
For ordered DV categories; models cumulative splits of the categories (proportional odds model, R: MASS::polr)
Cumulative splits for 4 ordered categories (0-3)
3 splits: 0 vs. 1,2,3; 0,1 vs. 2,3; 0,1,2 vs. 3
Proportional odds assumption
The predictor's effect (one b / odds ratio) is the same across every split; only the intercepts (thresholds, zeta) differ
Ordinal regression intercepts
Thresholds (zeta) on the underlying continuous scale separating adjacent categories
Ordinal deck example: age b = 0.103
OR = 1.108: each extra year multiplies the odds of being in a higher education level by 1.108 (10.8% higher)