Learn R Programming

api2lm (version 0.2)

rloo.lm: Compute leave-one-out residuals for `lm` objects.

Description

rloo.lm computes the leave-one-out residuals of the lm object stored in model.

rjackknife.lm and rdeleted.lm are aliases for rloo.lm.

Usage

# S3 method for lm
rloo(
  model,
  infl = stats::lm.influence(model, do.coef = FALSE),
  res = infl$wt.res,
  ...
)

# S3 method for lm rdeleted( model, infl = stats::lm.influence(model, do.coef = FALSE), res = infl$wt.res, ... )

# S3 method for lm rjackknife( model, infl = stats::lm.influence(model, do.coef = FALSE), res = infl$wt.res, ... )

Arguments

model

a fitted model object from the lm function.

infl

influence structure as returned by lm.influence.

res

(possibly weighted) residuals, with proper default.

...

Currently unimplemented

Author

Joshua French

Details

Let \(\hat{\epsilon}_i\) denote the residual of the \(i\)th observation and \(h_i\) denote the leverage value of the \(i\)th observation The leave-one-out residual for observation \(i\) is computed as

$$l_i = \frac{\hat{\epsilon}_i}{1-h_i}.$$

Examples

Run this code
lmod <- lm(Girth ~ Height, data = trees)
rloo(lmod)

Run the code above in your browser using DataLab