Get fitted values and residuals out of a model object
Source:R/zzz_auto_visual_inference.R
AUTO_VI-cash-get_fitted_and_resid.Rd
This function gets fitted values and residuals
out of a model object by using stats::fitted()
and stats::resid()
.
Examples
my_vi <- auto_vi(fitted_model = lm(speed ~ dist, data = cars))
my_vi$get_fitted_and_resid()
#> # A tibble: 50 × 2
#> .fitted .resid
#> <dbl> <dbl>
#> 1 8.62 -4.62
#> 2 9.94 -5.94
#> 3 8.95 -1.95
#> 4 11.9 -4.93
#> 5 10.9 -2.93
#> 6 9.94 -0.940
#> 7 11.3 -1.26
#> 8 12.6 -2.59
#> 9 13.9 -3.91
#> 10 11.1 -0.0986
#> # ℹ 40 more rows