Skip to content

The function generates fitted values for all models in a tidyfit.models frame and outputs a tidy frame.

Usage

# S3 method for tidyfit.models
fitted(object, ...)

Arguments

object

model.frame created using regress, classify or m

...

currently not used

Value

A 'tibble'.

Details

The function uses the 'model_object' column in a tidyfit.model frame to return fitted values for each model.

Author

Johann Pfitzinger

Examples

data <- dplyr::group_by(tidyfit::Factor_Industry_Returns, Industry)
fit <- regress(data, Return ~ ., m("lm"), .mask = "Date")
fitted(fit)
#> # A tibble: 7,080 × 3
#> # Groups:   Industry, model [10]
#>    Industry model fitted
#>    <chr>    <chr>  <dbl>
#>  1 Durbl    lm    -0.939
#>  2 Durbl    lm     6.82 
#>  3 Durbl    lm    -2.15 
#>  4 Durbl    lm     3.09 
#>  5 Durbl    lm    -0.317
#>  6 Durbl    lm     1.94 
#>  7 Durbl    lm     3.69 
#>  8 Durbl    lm     3.00 
#>  9 Durbl    lm     3.26 
#> 10 Durbl    lm    -0.814
#> # ℹ 7,070 more rows