14
Generalized Linear Models
Not every response variable will be continuous, so a linear regression will not be the correct model in every circumstance. Some outcomes may contain binary data (e.g., sick and not sick), or even count data (e.g., how many heads will I get when I flip a coin). A general class of models called generalized linear models (GLM) can account for these types of data, yet still use a linear combination of predictors.
About This Chapter
This chapter has been improved from its first edition version in a few ways. First, the data set example was changed to use the titanic
data set from the seaborn
library. The original code from the New York American Community Survey (ACS) was replaced with a new data set to make the model ...
Get Pandas for Everyone: Python Data Analysis, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.