Fit a generalized linear regression using glm()
. This function is still in early development stage.
glm_model(
data,
response_variable,
predictor_variable,
two_way_interaction_factor = NULL,
three_way_interaction_factor = NULL,
family,
quite = FALSE
)
data.frame
response variable. Support dplyr::select()
syntax.
predictor variable. Support dplyr::select()
syntax.
two-way interaction factors. You need to pass 2+ factor. Support dplyr::select()
syntax.
three-way interaction factor. You need to pass exactly 3 factors. Specifying three-way interaction factors automatically included all two-way interactions, so please do not specify the two_way_interaction_factor argument. Support dplyr::select()
syntax.
a GLM family. It will passed to the family argument in glm See ?glm
for possible options.
suppress printing output
an object class of glm
representing the linear regression fit
fit <- glm_model(
response_variable = incidence,
predictor_variable = period,
family = "poisson", # or you can enter as poisson(link = 'log'),
data = lme4::cbpp
)
#> Warning: The following columns are coerced into numeric: herd, period
#> Fitting Model with glm:
#> Formula = incidence ~ period