1
$\begingroup$
   install.packages("DiscriMiner")

   require(DiscriMiner)


   out <- plsDA(X, Y, autosel = TRUE, comps = 2, validation = NULL, learn = NULL, 
         test = NULL, cv = "LOO", k = NULL, retain.models = FALSE)

I have 133 subjects ( 60 % control and 40 % disease). I can obtain my R2Y cumulative through out$R2, which is 0.45.

enter image description here

However, when I do out$Q2, I get the Q2 for control (Q2.0) and for disease (Q2.4) and a global Q2. The average of the global Q2 is -0.15 which indicates that my model has no predictive relevance given the negative value.

enter image description here

Please could somebody clarify how I would calculate Q2Y cumulative?

$\endgroup$
1
$\begingroup$

To calculate $Q2Y$ manually with the following formula:

$$ Q2Y=1−∏_{i=1}^{N_{comp}}(1−Q2Y_i) $$

Using the package ropls you get it as an output of the model:

library(ropls)

data(iris)

mdl <- ropls::opls(iris[, 1:4], iris$Species, crossvalI=nrow(iris))
plot(mdl)

PLS-DA
150 samples x 4 variables and 1 response
standard scaling of predictors and response(s)
      R2X(cum) R2Y(cum) Q2(cum) RMSEE pre ort pR2Y  pQ2
Total    0.995    0.586    0.57 0.307   3   0 0.05 0.05

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank-you, I just found this package through a Google search! $\endgroup$ – undecided4567 Jul 4 '20 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.