glm(formula, family = gaussian, data = <<see below>>, weights = <<see below>>, subset = <<see below>>, na.action = na.fail, start = <<see below>>, control, trace = F, model = F, x = F, y = T, contrasts = NULL, qr = F, ...)
The response variable must conform with the definition of family, for example factor or binary data if family=binomial is declared.
The model is fit using Iterative Reweighted Least Squares (IRLS). The working response and iterative weights are computed using the functions contained in the family object. GLM models can also be fit using the function gam. The workhorse of glm is the function glm.fit which expects an x and y argument rather than a formula.
glm(skips ~ ., family = poisson, data = solder.balance) glm(Kyphosis ~ poly(Age, 2) + (Number > 5)*Start, family = binomial, data = kyphosis) glm(ozone^(1/3) ~ bs(radiation, 5) + poly(wind, temperature, degree = 2), data = air)