Calculates prediction sum of squares (PRESS) for a linear model.
Usage
press(Y, X)
Arguments
Y
A numeric vector containing the response variable.
X
A vector or matrix containing explanatory variables.
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.