Description Usage Arguments Details Value Examples
cv_model()
fits a model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | cv_model(x, ...)
## Default S3 method:
cv_model(x, ...)
## S3 method for class 'data.frame'
cv_model(x, y, intercept = TRUE, ...)
## S3 method for class 'matrix'
cv_model(x, y, intercept = TRUE, ...)
## S3 method for class 'formula'
cv_model(formula, data, intercept = TRUE, ...)
## S3 method for class 'recipe'
cv_model(x, data, intercept = TRUE, ...)
|
x |
Depending on the context:
|
... |
See Details |
y |
When
|
intercept |
Should intercept column be created? Default is |
formula |
A formula specifying the outcome terms on the left-hand side, and the predictor terms on the right-hand side. |
data |
When a recipe or formula is used,
|
Extra parameters using ...
are forwarded to implementation function.
These parameters are the following:
Model function. Default is lm_model
. See also
baseline_model
Predict function. Default is generic_predict
Model performance function. Default is performance_metrics
Function or numeric scalar. Default is SESOI_lower_func
Function or numeric scalar. Default is SESOI_upper_func
Control structure using model_control
. The parameters
used in cv_model
are cv_folds
, and cv_strata
Should NAs be removed? Default is FALSE. This is forwarded to
model_func
, predict_func
, perfr_func
, SESOI_lower
,
and SESOI_upper
In summary, cv_model
represents a wrapper function, that performs model_func
within
the cross-validation loop and provide it's predictive performance metrics using perf_func
A bmbstats_cv_model
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data("vertical_jump_data")
m1 <- cv_model(
`Post-test` ~ `Pre-test` * Group * `Squat 1RM`,
vertical_jump_data,
control = model_control(
cv_repeats = 10,
cv_folds = 3,
cv_strata = vertical_jump_data$Group
)
)
m1
plot(m1, "residuals")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.