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

View source: R/fit_lm.R

fit_lmR Documentation

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

Description

fit_lm is a function that fits a linear regression model and returns a 'model frame', and can keep the model matrix, etc.

Usage

fit_lm(
  formula,
  df,
  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_moels(
   linear_models, "formulas", "dfs", fun = fit_lm)
)

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