What is a Generalized Linear Model (GLM)?

The concept of Generalized Linear Model (GLM) extends the framework developed in linear regression to outcomes that are not normally distributed, such as binary, count, or proportion data. 

There are three main components of a GLM:

(a) a random component,

(b) a structural component, and

(c) a link function

The random component refers to the response variable that is assumed to be a random variable following some known statistical distribution. For example, binary data is usually assumed to be generated through independent Bernoulli trials, where on each trial, there is a constant proportion of success, denoted as p. The structural component refers to the linear combination of regression coefficients and predictors, which are not considered to be random variables. Finally, the link function is where the magic of GLM occurs, in which through some transformation, the outcome can be linearly related to the set of predictors and their coefficients. This transformation turns a non-linear relationship into something that can be modeled using many of the same concepts as linear regression.