Learn R Programming

datana (version 1.1.2)

pressind: Function to compute the PRESS statistics of a regression model .

Description

Computes the PRESS (Predicted residual sum of squares) statistics of a regression model.

Usage

pressind(model = model)

Value

The main output is the PRESS statistics

Arguments

model

an object having the fitted model.

Author

Christian Salas-Eljatib.

Details

The function computes the PRESS based on the Hat matrix of a previously fitted model.

References

  • Myers RH. 1990. Classical and Modern Regression with Applications. Second Edition. Duxbury Classic Series, Pacific Grove, CA, USA.

Examples

Run this code

#Creates a fake dataframe
set.seed(12)
df <- as.data.frame(cbind(Y=rnorm(30, 30,9), X=rnorm(30, 450,133)))
#fitting a candidate model
mod1 <- lm(Y~X, data=df)
#Using the `pressind` function
pressind(mod1)

Run the code above in your browser using DataLab