Skip to contents

This function gets rotated residuals from a fitted linear model. The rotated residuals are generated by first regressing random noises on the original regressors, then multiply the obtained residuals by original RSS divided by the current RSS. The results are the rotated residuals.

Usage

AUTO_VI$rotate_resid(fitted_model = self$fitted_mod)

Arguments

fitted_model

lm. A linear model object.

Value

A tibble with two columns .fitted and .resid.

Examples


my_vi <- auto_vi(fitted_model = lm(speed ~ dist, data = cars))
rotated_resid <- my_vi$rotate_resid()
my_vi$plot_resid(rotated_resid)