Lecture 22. GLM
Lecture 22. GLM
LECTURE 22
BINARY VARIABLES AND LOGISTIC REGRESSION: FROM BASICS TO APPLICATIONS
What is a binary random variable?
Parameters:
: Intercept
: Slope (effect of the explanatory variable)
Interpretation: Odd increase by exp(β1) for a one-unit increase in X.
Graphical Representation: S-shaped logistic curve showing the
probability of Y=1 as X changes.
Example
General Logistic Regression Model
Dependent Variable:
Binary (e.g., 0 or 1).
Independent Variables:
Can be continuous, categorical, or a mix.
Odds and Odds Ratio:
Estimation of Parameters
Deviance:
Measures lack of fit
Hosmer-Lemeshow Test:
Compares observed and predicted values in grouped data.
Pseudo :
McFadden’s, Cox-Snell, and Nagelkerke’s .
Deviance Measure
𝑦𝑖 𝑛𝑖 −𝑦𝑖
𝐷=2 𝑖 y𝑖 ln 𝑦𝑖
+ (𝑛𝑖 − y𝑖 ) ln 𝑛 𝑖 − 𝑦𝑖
Where:
Yi: Observed outcome for the i-th
observation (Yi∈{0,1}
Deviance measure and chi square test
Other Goodness of Fit statistic
AIC
BIC
Pseudo-R squared
In a linear regression, the coefficient of determination R2 indicates the
proportion of the explained variance.
In logistic regression, the dependent variable is scaled nominally or ordinally
and it is not possible to calculate a variance, so the coefficient of
determination cannot be calculated in logical regression.