View source: R/cross_fit_glm.R
cross_fit_glm | R Documentation |
Cross fit generalized linear models
cross_fit_glm( data, formulas, cols = NULL, weights = NULL, families = gaussian(link = identity), fn_args = list(), tidy = tidy_glance, tidy_args = list(), errors = c("stop", "warn") )
data |
A data frame |
formulas |
A list of formulas to apply to each subset of the data.
If named, these names will be used in the |
cols |
Columns to subset the data.
Can be any expression supported by
< |
weights |
A list of columns passed to |
families |
A list of glm model families.
Defaults to |
fn_args |
A list of additional arguments to |
tidy |
A logical or function to use to tidy model output into
data.frame columns.
If |
tidy_args |
A list of additional arguments to the |
errors |
If |
A tibble with a column for the model formula,
columns for subsets,
columns for the model family and type,
columns for the weights (if applicable),
and columns of tidy model output or a list column of models
(if tidy = FALSE
)
cross_fit()
to use any modeling function.
cross_fit_glm( data = mtcars, formulas = list(am ~ gear, am ~ cyl), cols = vs, families = list(gaussian("identity"), binomial("logit")) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.