MVA.cv and MVA.cmv for more details about how cross (model) validation is performed.MVA.test(X, Y, cmv = FALSE, ncomp = 5, kout = 7, kinn = 8, model = c("PLSR",
"CPPLS", "PLS-DA", "PPLS-DA", "LDA", "QDA", "PLS-DA/LDA", "PLS-DA/QDA",
"PPLS-DA/LDA","PPLS-DA/QDA"), Q2diff = 0.05, lower = 0.5, upper = 0.5,
Y.add = NULL, weights = rep(1, nrow(X)), set.prior = FALSE,
crit.DA = c("plug-in", "predictive", "debiased"), p.method = "fdr",
nperm = 999,...)cppls.fit).cppls.fit).cppls.fit).cppls.fit).TRUE, the prior probabilities of class membership are defined according to the mean weight of individuals belonging to each class. If FALSE, prior propredict.lda.p.adjust.Y consists in quantitative response(s), the null hypothesis is that each response is not predicted better than what would happen by chance. In this case, Q2 is used as the test statistic. When Y contains several responses, a p-value is computed for each response and p-values are corrected for multiple testing.
When Y is a factor, the null hypothesis is that the factor has no discriminant ability. In this case, the proportion of misclassified individuals (NMC) is used as the test statistic.
Whatever the response, the reference value of the test statistic is obtained by averaging 20 values coming from independently performed cross (model) validation on the original data.
The function deals with the limitted floating point precision, which can bias calculation of p-values based on a discrete test statistic distribution.MVA.cv, MVA.cmvrequire(pls)
require(MASS)
# PLSR
data(yarn)
MVA.test(yarn$NIR,yarn$density,cmv=TRUE,model="PLSR")
# PPLS-DA coupled to LDA
data(mayonnaise)
MVA.test(mayonnaise$NIR,factor(mayonnaise$oil.type),model="PPLS-DA/LDA",crit.inn="NMC")Run the code above in your browser using DataLab