CVbinary | R Documentation |
These functions give training (internal) and cross-validation measures of predictive accuracy for regression with a binary response. The data are randomly divided between a number of ‘folds’. Each fold is removed, in turn, while the remaining data are used to re-fit the regression model and to predict at the omitted observations.
CVbinary(obj, rand=NULL, nfolds=10, print.details=TRUE)
cv.binary(obj, rand=NULL, nfolds=10, print.details=TRUE)
obj |
a |
rand |
a vector which assigns each observation to a fold |
nfolds |
the number of folds |
print.details |
logical variable (TRUE = print detailed output, the default) |
cvhat |
predicted values from cross-validation |
internal |
internal or (better) training predicted values |
training |
training predicted values |
acc.cv |
cross-validation estimate of accuracy |
acc.internal |
internal or (better) training estimate of accuracy |
acc.training |
training estimate of accuracy |
The term ‘training’ seems preferable to the term ‘internal’ in connection with predicted values, and the accuracy measure, that are based on the observations used to derive the model.
J.H. Maindonald
glm
frogs.glm <- glm(pres.abs ~ log(distance) + log(NoOfPools),
family=binomial,data=frogs)
CVbinary(frogs.glm)
mifem.glm <- glm(outcome ~ ., family=binomial, data=mifem)
CVbinary(mifem.glm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.