Learn R Programming

RVAideMemoire (version 0.9-35)

PLSDA.test: Permutational test for the discriminant ability of the factor in PLS-DA

Description

Perform a permutational test based on the classification error rate of a PLS-DA model, to test for the discriminant ability of the factor.

Usage

PLSDA.test(model, pred.method = c("mahalanobis.dist", "centroids.dist", "max.dist"),
  M = 10, nperm = 999)

Arguments

model
object of class "plsda" (from plsda).
pred.method
prediction method to be applied for PLS-DA cross-validation. Should be a subset of "mahalanobis.dist" (default), "centroids.dist" or "max.dist".
M
the number of folds in the M-fold cross-validation.
nperm
number of permutations.

Value

  • methoda character string giving the name of the test.
  • data.namea character string giving the name(s) of the data and parameters of the cross-validation.
  • p.valuep-value of the permutational test.
  • alternativea character string describing the alternative hypothesis, always "greater".
  • null.valuethe classification error rate obtained from the original model.
  • estimatethe classification error rate obtained from the original model.
  • pred.methoddistance criterion used in cross-validation.
  • Mnumber of folds in the M-fold cross-validation.
  • permutationsnumber of permutations.

Warning

The process is quite long and takes several minutes to be achieved. Just don't worry.

Details

Data have to be balanced to perform the test. The function automatically takes care of it by taking equal number of individuals in each class of the factor, randomly chosen for each class and in each permutation. The number of individuals kept is equal to the number of individuals in the smallest class. To compare classification error rates of the original and permuted models, classification error rate of the original model must be obtained with balanced data. The function does this by randomly choosing equal number of individuals in each class (as in the permutation process). However, to avoid basing the test on an original classification error rate obtained from non representative individuals, the process is repeated 30 times and the mean of these 30 values is considered as the classification error rate of the original model.

See Also

plsda, valid

Examples

Run this code
# Not enough permutations here but it runs faster.

require(mixOmics)
data(yeast)
X <- t(yeast$data)
Y <- yeast$strain.cond
model <- plsda(X,Y)
PLSDA.test(model,M=3,nperm=29)

Run the code above in your browser using DataLab