Learn R Programming

flashlight (version 0.3.0)

residuals.flashlight: Residuals for flashlight

Description

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

Usage

# S3 method for flashlight
residuals(object, ...)

Arguments

object

An object of class flashlight.

...

Arguments used to update the flashlight before calculating the residuals.

Value

A numeric vector with residuals.

Examples

Run this code
# NOT RUN {
fit <- lm(Sepal.Length ~ ., data = iris)
(fl <- flashlight(model = fit, data = iris, y = "Sepal.Length", label = "ols"))
residuals(fl)[1:5]
residuals(fl, data = iris[1:5, ])
residuals(fl, data = iris[1:5, ], linkinv = exp)
resid(fl)[1:5]
# }

Run the code above in your browser using DataLab