PLS-DA with CLR data


I am attempting to use PLS-DA on my geochemical (compositional) dataset. In my field is recommended to apply centered log-ratio before using multivariate statistical methods and I’ve been able to successfully use the code described here Chapter 4 PLS - Discriminant Analysis (PLS-DA) | mixOmics vignette up to the point below, where I get the error listed:

MyPerf.plsda ← perf(MyResult.plsda2, validation = “Mfold”, folds = 3,

  •                  progressBar = FALSE, nrepeat = 50) # we suggest nrepeat = 50

Error in solve.default(t(Pmat[, 1:x]) %*% Wmat[, 1:x]) :
system is computationally singular: reciprocal condition number = 4.39773e-34

To perform the CLR, I used the function cenLR from robCompositions. To give you some more insight into my dataset, I have 10 variables (chemical elements) and one categorical variable with a total of 970 analyses (without any censored data). I also used the PLS-DA without using the CLR function, and it worked fine, so I believe that this error has something to do with this transformation. Do you have any recommendations regarding this?

I really appreciate any help you can provide.

hi @mscodeco

Have a look at this workflow here: did you have a look at the data themselves? Our CLR transformation should be similar to those of robCompositions, except that we offset the whole data set by one.