Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lmCV

Repeated Cross Validation for lm


Description

Repeated Cross Validation for multiple linear regression: a cross-validation is performed repeatedly, and standard evaluation measures are returned.

Usage

lmCV(formula, data, repl = 100, segments = 4, segment.type = c("random", "consecutive", 
"interleaved"), length.seg, trace = FALSE, ...)

Arguments

formula

formula, like y~X, i.e., dependent~response variables

data

data set including y and X

repl

number of replication for Cross Validation

segments

number of segments used for splitting into training and test data

segment.type

"random", "consecutive", "interleaved" splitting into training and test data

length.seg

number of parts for training and test data, overwrites segments

trace

if TRUE intermediate results are reported

...

additional plotting arguments

Details

Repeating the cross-validation with allow for a more careful evaluation.

Value

residuals

matrix of size length(y) x repl with residuals

predicted

matrix of size length(y) x repl with predicted values

SEP

Standard Error of Prediction computed for each column of "residuals"

SEPm

mean SEP value

RMSEP

Root MSEP value computed for each column of "residuals"

RMSEPm

mean RMSEP value

Author(s)

Peter Filzmoser <P.Filzmoser@tuwien.ac.at>

References

K. Varmuza and P. Filzmoser: Introduction to Multivariate Statistical Analysis in Chemometrics. CRC Press, Boca Raton, FL, 2009.

See Also

Examples

data(ash)
set.seed(100)
res=lmCV(SOT~.,data=ash,repl=10)
hist(res$SEP)

chemometrics

Multivariate Statistical Analysis in Chemometrics

v1.4.2
GPL (>= 3)
Authors
Peter Filzmoser and Kurt Varmuza
Initial release
2017-03-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.