plotLoadings resulting in no bars

Hi, I hope all is well. I am trying to understand why my plotLoadings looks odd.

I am running the following code using my own dataset:

srbct.splsda ← splsda(X, Y, ncomp = 10)

perf.splsda.srbct ← perf(srbct.splsda, validation = “Mfold”,
folds = 5, nrepeat = 10,
progressBar = FALSE, auc = FALSE)

Note: this errors if I run AUC=TRUE (Error in cut.default(cases, thresholds) : ‘breaks’ are not unique)

Output:

perf.splsda.srbct$choice.ncomp

Output:
max.dist centroids.dist mahalanobis.dist
overall 1 1 1
BER 1 1 1

list.keepX ← c(1:7)

tune.splsda.srbct ← tune.splsda(X, Y, ncomp = 1,
validation = ‘Mfold’,
folds = 5, nrepeat = 10,
dist = ‘centroids.dist’,
measure = “BER”,
test.keepX = list.keepX)

Output:

final.splsda ← splsda(X, Y,
ncomp = 1,
keepX = 7)

plotLoadings(final.splsda, comp = 1, contrib = ‘max’, method = ‘median’)

Note: If works if I change contrib to NULL

plotLoadings(final.splsda, comp = 1, contrib = NULL, method = ‘median’)

hi @Santi,

I agree your output looks odd and we have not had any reports like this. Given the error from the AUC, I suspect that the medians are the same for those variables per group (or for some of them). Could you have a look? Maybe you need to set up method = ‘mean’.

If that still does not work, you can send me you .RData with the code you ran via email and I can have a look.

Kim-Anh

Dear Kim-Anh,

Thank you so much for your help. I tried running method=“mean” but it still errored.
I am attaching the code that I ran and the data. The data is binary. I don’t know if that is the issue? The results do make sense from other analyses.

thank you,

Santi

(Attachment Mixomics_X.rds is missing)

(Attachment Mixomics_Y.rds is missing)

(Attachment Mixomics_code_Santi.R is missing)

I will email the data directly.

hi @Santi,

The mixOmics methods are not really made for binary data. What happens in this output is that the mean or median are the same across groups, and so we can’t color the bar as we have a tie.

You can still use the other outputs, just not this barplot.

Kim-Anh

Dear Kim-Anh,

Thank you very much! Can I just check one more thing? The data is not only binary but a given sample with have only one of the features (value 1) and the rest will be 0.

So
sample 1: VH1-2=1, all other VH will be 0
sample 2: VH3-53=1, all other VH will be 0

Is this an issue?

thank you,

Santi

Hi Santi,

This will not be so much of an issue, but it may result in having variables that have the same variance (i.e identical values across all samples) and those cannot be dealt with (they do not bring any information in the analysis). Regardless, the primary problem faced here is the binary nature of the data. You can have a look at correspondence analysis that can deal with nominal data (not sure if there are any good packages out there).

Kim-Anh