In the previous chapters, we have worked with regression models where the response variable is quantitative and normally distributed. Now, we turn our attention to models where the response variable is discrete and the error terms do not follow a normal distribution. Such models are called GLMs.
GLMs are extensions of traditional regression models that allow the mean to depend on the explanatory variables through a link function, and the response variable to be any member of a set of distributions called the exponential family (such as Binomial, Gaussian, Poisson, and others).
In R, to fit GLMs we can use the glm() function. The model is specified by giving a symbolic description of the linear predictor and a description of the error distribution. Its usage is similar to that of the function lm() which we previously used for multiple linear regression...