press: prediction sum of squares

View source: R/press.R

pressR Documentation

prediction sum of squares

Description

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

Usage


press(lm, as.R2 = FALSE)

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.

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.

Value

Returns the PRESS statistic.

Author(s)

Ken Aho

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

Y <- rnorm(100)
X <- rnorm(100)
press(lm(Y ~ X))

asbio documentation built on May 29, 2024, 5:57 a.m.