MMUPHin-Adjust_batch() error

Hello,

I am trying to adjust for batch effects between eleven microbiome studies and their relative abundance data using adjust_batch() but am receiving the following error:

Error in MMUPHin::adjust_batch(feature_abd = CRC_abd, batch = “study”, :
Covariates and batch are confounded!

Is this means that there is some correlation between batches and covariates?

If this helps, I have twelve covariates. I’ve lowered covariates to five by combining some of them (because I thought that problem is that in one study there is more than one covariate) but I received the same error. Finally, when I change covariates into two categories (control and treatment) it works, but in the wrong way because it shows that there is no difference between the two covariates.

Any guidance would be appreciated! Thank you

Is this means that there is some correlation between batches and covariates?

Unfortunately it’s worse than that. Your batch and covariates are not just correlated, they are linearly dependent. To be more specific, the matrix whose columns are your batch and covariate variables is not full rank.

You could try looking at model.matrix(~ <your batch variables> + <your covariates>, data = your_data) to identify which columns are not independent and/or make sure the software is encoding your variables in the way you intend.

Thank you so much,it was really helpful.