Paired splsda with only two times

Hello everyone!
I have paired microbiota data collected at two times (A and B) in which some patients responded well to treatment and others did not. I would like to do a sPLSDA on these data, predicting response based on bacterial content but using the data in as paired. I have tried multilevel sPLSDA analysis but in that case needs more than two levels! Do you have any advice? What could I do?

Thank you!

hi @Michela,

Welcome back!
The sPLS-DA multilevel should still work with two time points, I think the error you are mentioning is telling you that there are some samples that are not repeated, could you check this?

If that is still not working, you can send us your .RData at mixomicsdeveloper[@]gmail.com and we will have a quick look (and keep it confidential).

The other option is to only consider t2-t1 (i.e, somewhat subtracting for the ‘baseline’).

In either option just be mindful of what you mean by ‘predicting’. I.e are you predicting that an individual will respond or not to treatment (in case I think option 2 is preferable), or whether you can predict a sample (within an individual) is responding to treatment (potentially option 1 - I dont know your experimental design and how you define Y, so this is only a guess).

Kim-Anh

I have this error:

splsda_model ← mixOmics::splsda(X, Y,

  •                              ncomp = optimal.ncomp, 
    
  •                              keepX = optimal.keepX,
    
  •                              multilevel = design)
    

Error in rowSums(Y) : ‘x’ must be an array with 2 dimension

but if I delete multilevel = designe the error disapeare! (design ← data.frame(sample = condition$tempo)) where tempo is A or B like t1 and t2