CVerror {smallstuff} | R Documentation |
k-Fold Cross Validation Error Rate
Description
Given a logistic regression model (via glm), or an LDA or QDA model, and a number of folds k, the k-Fold CV error rate is calculated.
Usage
CVerror(mod, k = nrow(stats::model.frame(mod)))
Arguments
mod |
A logistic regression, LDA, or QDA model |
k |
Number of folds; by default LOOCV will be returned |
Value
The k-fold CV error rate if k is entered, otherwise the LOOCV error rate.
Examples
mtcars$am=as.factor(mtcars$am)
gmod=glm(am~mpg,binomial,mtcars)
CVerror(gmod)
[Package smallstuff version 1.0.3 Index]