Description
Performs cross validation with correspondence discriminant analyses.
Usage
CDA.cv(X, Y, repet = 10, k = 7, ncomp = NULL, method = c("mahalanobis",
"euclidian"))
Arguments
X
a data frame of dependent variables (typically contingency or presence-absence table).
Y
factor giving the groups.
repet
an integer giving the number of times the whole procedure has to be repeated.
k
an integer giving the number of folds (can be re-set internally if needed).
ncomp
an integer giving the number of components to be used for prediction. If NULL
all components are used.
Value
repetnumber of times the whole procedure was repeated.
knumber of folds.
ncompnumber of components used.
methodcriterion used to classify individuals of the test sets.
groupslevels of Y
.
models.listlist of of models generated (repet*k
models), for PLSR, CPPLS, PLS-DA, PPLS-DA, LDA and QDA.
NMCClassification error rates (repet
values).
Details
The training sets are generated in respect to the relative proportions of the levels of Y
in the original data set (see splitf
).
Examples
Run this code# NOT RUN {
require(ade4)
data(perthi02)
# }
# NOT RUN {
CDA.cv(perthi02$tab,perthi02$cla)
# }
Run the code above in your browser using DataLab