cross_fit_glm {crossmap} | R Documentation |
Cross fit generalized linear models
Description
Cross fit generalized linear models
Usage
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")
)
Arguments
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 |
Value
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
)
See Also
cross_fit()
to use any modeling function.
Examples
cross_fit_glm(
data = mtcars,
formulas = list(am ~ gear, am ~ cyl),
cols = vs,
families = list(gaussian("identity"), binomial("logit"))
)