Residuals method for an object of class "multiflashlight". Pass additional elements to update the multiflashlight before calculation of residuals.

# S3 method for class 'multiflashlight'
residuals(object, ...)

Arguments

object

An object of class "multiflashlight".

...

Arguments used to update the multiflashlight before calculating the residuals.

Value

A named list with residuals per flashlight.

Examples

fit_part <- lm(Sepal.Length ~ Petal.Length, data = iris)
fit_full <- lm(Sepal.Length ~ ., data = iris)
mod_full <- flashlight(model = fit_full, label = "full")
mod_part <- flashlight(model = fit_part, label = "part")
mods <- multiflashlight(list(mod_full, mod_part), data = iris, y = "Sepal.Length")
residuals(mods, data = head(iris))
#> $full
#>           1           2           3           4           5           6 
#>  0.09521198  0.14315645 -0.07309695 -0.28935683 -0.05437691  0.01111427 
#> 
#> $part
#>          1          2          3          4          5          6 
#>  0.2209054  0.0209054 -0.1382024 -0.3199868  0.1209054  0.3982287 
#>