coef.tidyfit.models {tidyfit} | R Documentation |
Extract coefficients from a tidyfit.models
frame
Description
The function extracts and prepares coefficients from all models in a tidyfit.models
frame and outputs a tidy frame of estimates.
Usage
## S3 method for class 'tidyfit.models'
coef(
object,
...,
.add_bootstrap_interval = FALSE,
.bootstrap_alpha = 0.05,
.keep_grid_id = FALSE
)
Arguments
object |
|
... |
currently not used |
.add_bootstrap_interval |
calculate bootstrap intervals for the parameters. See 'Details'. |
.bootstrap_alpha |
confidence level used for the bootstrap interval. Default is |
.keep_grid_id |
boolean. By default the grid ID column is dropped, if there is only one unique setting per model or group. |
Details
The function uses the 'model_object' column in a tidyfit.model
frame to return a data frame of estimated coefficients.
Results are 'tidied' using broom::tidy
whenever possible.
All coefficients are transformed to ensure statistical comparability. For instance, standardized coefficients are always transformed back to the original data scale, naming conventions are harmonized etc.
Bootstrap intervals
Bootstrap intervals can be calculated using rsample::int_pctl
. Only set .add_bootstrap_interval = TRUE
if you are using .cv = "bootstraps"
in combination with .return_slices = TRUE
to generate the model frame.
Value
A 'tibble'.
Author(s)
Johann Pfitzinger
See Also
predict.tidyfit.models
, fitted.tidyfit.models
and residuals.tidyfit.models
Examples
data <- tidyfit::Factor_Industry_Returns
fit <- regress(data, Return ~ ., m("lm"), .mask = c("Date", "Industry"))
coef(fit)