Learn R Programming

blmeco (version 1.0)

ocv: Ordinary cross validation score

Description

Sum of squared differences between the out-of-data prediction and the observation for the leave-one-out cross validation for linear models with normal error structure (lm-objects)

Usage

ocv(mod)

Arguments

mod
an lm-object

Value

  • the ordinary cross validation score

References

e.g. Wood, SN (2006) Generalized Additive Models, An Introduction with R. Chapman & Hall/CRC, London.

Examples

Run this code
data(pondfrog1)
mod1 <- lm(log(frog+1)~ph, data=pondfrog1)
mod2 <- lm(log(frog+1)~waterdepth, data=pondfrog1)
ocv(mod1)
ocv(mod2)

Run the code above in your browser using DataLab