Learn R Programming

asbio (version 0.2-1)

press: prediction sum of squares

Description

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.

See Also

cor

Examples

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

Run the code above in your browser using DataLab