This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' @title PRESS | |
#' @author Thomas Hopper | |
#' @description Returns the PRESS statistic (predictive residual sum of squares). | |
#' Useful for evaluating predictive power of regression models. | |
#' @param linear.model A linear regression model (class 'lm'). Required. | |
#' | |
PRESS <- function(linear.model) { | |
#' calculate the predictive residuals | |
pr <- residuals(linear.model)/(1-lm.influence(linear.model)$hat) | |
#' calculate the PRESS |