fit_glm: Fit linear (regression) model and return fit (not tidied,...

View source: R/fit_glm.R

fit_glmR Documentation

Fit linear (regression) model and return fit (not tidied, just regular)

Description

fit_glm is like fit_lm but for a glm I guess ... a function that fits a general linear regression model and returns a 'model frame', and can keep the model matrix, etc.

Usage

fit_glm(
  formula,
  df,
  family = quasipoisson,
  replacement_names = NULL,
  keep_data = TRUE,
  y = TRUE,
  qr = TRUE,
  keep_model_matrix = FALSE
)

Arguments

keep_data

whether to return the model frame?

qr

whether to keep the 'QR decomposition', a factorization of the (?) model matrix

keep_model_matrix

whether to keep the model matrix

Examples

 linear_models <- linear_models %>%
mutate(
 lm_fit = fit_models(
   linear_models, "formulas", "dfs", fun = fit_lm)
)

rethinkpriorities/rp-r-package documentation built on Jan. 7, 2023, 10:11 p.m.