press {asbio} | R Documentation |
Calculates PREdiction Sum of Squares (PRESS) for a linear model.
press(lm, as.R2 = FALSE)
lm |
An object of class |
as.R2 |
Logical. Whether or not output should be expressed as predicted |
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.
Returns the PRESS statistic.
Ken Aho
Kutner, M. H., Nachtsheim, C. J., Neter, J., and W. Li (2005) Applied Linear Statistical Models, 5th edition. McGraw-Hill, Boston.
Y <- rnorm(100)
X <- rnorm(100)
press(lm(Y ~ X))