Learn R Programming

asbio (version 1.9-7)

press: prediction sum of squares

Description

Calculates PREdiction Sum of Squares (PRESS) for a linear model.

Usage

press(lm, as.R2 = FALSE)

Value

Returns the PRESS statistic.

Arguments

lm

An object of class lm.

as.R2

Logical. Whether or not output should be expressed as predicted \(R^2\), i.e., \(PRESS/TSS\).

Author

Ken Aho

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

Examples

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

Run the code above in your browser using DataLab