CVbinary {DAAG} | R Documentation |
Cross-Validation for Regression with a Binary Response
Description
This function gives internal and cross-validation measures of predictive
accuracy for regression with a binary response. The data are
randomly assigned to a number of `folds'.
Each fold is removed, in turn, while the remaining data is used
to re-fit the regression model and to predict at the deleted observations.
Usage
CVbinary(obj=frogs.glm, rand=NULL, nfolds=10, print.details=TRUE)
Arguments
obj |
a glm object |
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) |
Value
cv |
predicted values from cross-validation |
internal |
internal predicted values |
cv |
cross-validation estimate of accuracy |
internal |
internal estimate of accuracy |
Author(s)
J.H. Maindonald
See Also
glm
Examples
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)
[Package
DAAG version 0.98
Index]