GLM model families

There are several GLM model families depending on the make-up of the response variable. These includes three well-known GLM model families:

  • Binomial: The binomial family is used for binary response variables (i.e., two categories) and assumes a binomial distribution.

R




# Fit a logistic regression model using the binomial family
model <- glm(binary_response_variable ~ predictor_variable1 + predictor_variable2,
            family = binomial(link = "logit"), data = data)


  • Gaussian: This family is used for continuous response variables and assumes a normal distribution. The link function for this family is typically the identity function.

R




# Fit a linear regression model using the gaussian family
model <- glm(response_variable ~ predictor_variable1 + predictor_variable2,
            family = gaussian(link = "identity"), data = data)


  • Gamma: The gamma family is used for continuous response variables that are strictly positive and have a skewed distribution.

R




# Fit a gamma regression model using the gamma family
model <- glm(positive_response_variable ~ predictor_variable1 + predictor_variable2,
            family = gamma(link = "inverse"), data = data)


  • Quasibinomial: When a response variable is binary but has a higher variance than would be predicted by a binomial distribution, the quasibinomial model is utilized. This could happen if the response variable has excessive dispersion or additional variation that the model is not taking into account. 

R




# Fit a quasibinomial model
model <- glm(response_variable ~ predictor_variable1 + predictor_variable2,
            family = quasibinomial(), data = data)


Generalized Linear Models Using R

GLM stands for Generalized Linear Models in R Programming Language. It is a flexible framework used in various statistical models, including linear regression, logistic regression, Poisson regression, and many others.

GLMs (Generalized linear models) are a type of statistical model that is extensively used in the analysis of non-normal data, such as count data or binary data. They enable us to describe the connection between one or more predictor variables and a response variable in a flexible manner. This tutorial will go over how to create generalized linear models in the R Programming Language.

Similar Reads

Major components of GLMs

a probability distribution for the response variable,  a linear predictor function of the predictor variables, and  a link function that connects the linear predictor to the response variable’s mean....

GLM model families

There are several GLM model families depending on the make-up of the response variable. These includes three well-known GLM model families:...

Building a Generalized Linear Model

...

Contact Us