Module 8: Generalized Linear Models
In this module, we will take a look at generalize linear models.
A generalized linear model (GLM) is a flexible generalization of ordinary least squares (OLS) regression. It extends OLS to accommodate a wider range of response variables beyond continuous data and allows for non-linear relationships between the response and predictor variables.
Here’s how they differ:
Response variable: OLS assumes the response variable is continuous and normally distributed. GLMs can handle various types of response variables, including binary (e.g., yes/no), count (e.g., number of events), or categorical.
Link function: GLMs introduce a link function that connects the linear predictor (combination of predictor variables) to the expected value of the response variable. This allows for modeling non-linear relationships. OLS implicitly uses the identity link function, assuming a direct linear relationship.
Error distribution: OLS assumes the errors are normally distributed. GLMs allow for different error distributions, such as binomial, Poisson, or gamma, depending on the nature of the response variable.
In essence, GLMs provide a more general framework for modeling relationships between variables, while OLS is a special case within this framework.
Lecture Videos
Lecture Notes
Lecture notes displayed in the lectures can always be found at the lecture notes website.
Introduction to Link Functions
Introduction to GLMs
Logistic Regression as a GLM
Credit Default Data
Regular Linear Regression versus Logistic Regression
Predictions and Classification in Logistic Regression
Confusion Matrices
Combining Categorical and Quantitative Predictors in Models
Mesothelioma Data
Initial Variable Removal and VIF Removal
- Redundancy is the same as linear regression.
Form of the Residuals
DHARMa to examine residuals
📚 Recommended Reading & Other Content
Quant Psych
Playlist on generalized linear models