VIP by groups in PLS-DA

Hi, it is my first time in the forum.

I have a question about VIP (Variable Importance for Projection) in PLS-DA analysis. Do you know whether it is possible to do this graph in MixOmics?

VIP is shown by group and not by component or to overall model.

Thanks very much.

Hi @enzo and welcome!
Unfortunately, we only provide the VIP for each variable and up to a component, as given in example(vip) (with a barplot).

X <- linnerud$exercise
Y <- linnerud$physiological
linn.pls <- pls(X, Y) <- vip(linn.pls)

beside = TRUE, col = c("lightblue", "mistyrose", "lightcyan"),
ylim = c(0, 1.7), legend = rownames(,
main = "Variable Importance in the Projection", font.main = 4)

You might be able to tweak this output for your needs. At the moment we do not have more capacity for such enhancements.


Thanks very much for your response.

But, theoretically is it possible calculate a VIP by variable by group for whole model?

I don’t find paper with this plot type except this one.

Hi @enzo,

Per model: yes you would consider only the last component value.
Per group: I assume you mean per sample group. I dont see how this can be calculated, here are the formula we use, feel free to tweak the vip() function for your own needs.

From our current handbook (in preparation):



me neither, I don’t see how this estimate per sample group can be calculated.

Another question (I’m sorry for asking so many questions). Could I calculate Q2, R2 with MixOmics?

Thanks again


hi @enzo
We have the R2 and Q2 for a PLS object using the perf() function. We have not implemented it for PLS-DA. You could do it manually by inputing Y as a dummy matrix (Y.dummy <- map(Y)) then input in pls(X, Y.dummy), although we never really tested. Q2 and R2 seem best defined for a regression model rather than classification.