Learn R Programming

asbio (version 1.0-5)

press: prediction sum of squares

Description

Calculates prediction sum of squares (PRESS) for a linear model.

Usage

press(lm)

Arguments

lm
An object of class lm.

Value

  • Returns the PRESS statistic.

Details

The press statistic is calculated as: $$\sum_{i=1}^{n}d_i^2$$ where $$d_i = \frac{e_i}{1-h_{ii}}$$ where $h_{ii}$ is the ith diagonal element in the hat matrix.

References

Kutner, M. H., Nachtsheim, C. J., Neter, J., and W. Li. 2005. Applied linear statistical models, 5th edition. McGraw-Hill, Boston.

See Also

cor

Examples

Run this code
Y <- rnorm(100)
X <- rnorm(100)
press(lm(Y ~ X))

Run the code above in your browser using DataLab