16.5 Programming GLM’s in R¶
To fit a GLM in R you will need to use the glm() function where we tell R what the distribution of the errors and linear predictor should be.
The function syntax is as followed:
glm(formula, family = gaussian, data, weights, subset,
na.action, start = NULL, etastart, mustart, offset,
control = list(…), model = TRUE, method = "glm.fit",
x = FALSE, y = TRUE, singular.ok = TRUE, contrasts = NULL, …)
The minimal inputted parameters required is the formula and the family. The formula tells R in a symbolic description what model is required to be fitted and the family describes what error distribution and link function are required.