glm_model: Generalized Linear Regression

View source: R/glm_model.R

glm_modelR Documentation

Generalized Linear Regression

Description

[Experimental]
Fit a generalized linear regression using glm(). This function is still in early development stage.

Usage

glm_model(
  data,
  response_variable,
  predictor_variable,
  two_way_interaction_factor = NULL,
  three_way_interaction_factor = NULL,
  family,
  quite = FALSE
)

Arguments

data

data.frame

response_variable

response variable. Support dplyr::select() syntax.

predictor_variable

predictor variable. Support dplyr::select() syntax.

two_way_interaction_factor

two-way interaction factors. You need to pass 2+ factor. Support dplyr::select() syntax.

three_way_interaction_factor

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.

family

a GLM family. It will passed to the family argument in glmer. See ?glmer for possible options.

quite

suppress printing output

Value

an object class of glm representing the linear regression fit

Examples

fit <- glm_model(
  response_variable = incidence,
  predictor_variable = period,
  family = "poisson", # or you can enter as poisson(link = 'log'),
  data = lme4::cbpp
)

psycModel documentation built on Nov. 2, 2023, 6:02 p.m.