Question: interaction between continious and categorical variables
gravatar for fabian.roger
12 days ago by
fabian.roger0 wrote:


I am using Deseq2 in conjuncture with Phyloseq to check for deferentially abundant OTUs along a natural gradient. My sample come from different habitats and I know that the community composition differs between the habitats. I am interested in which OTUs co-vary with the continuous predictor in each habitat (4 levels). I tried the following model:

~ Habitat + continuous_predictor + Habitat:continuous_predictor

followed by results ( ... name = Habitat_1.continuous_predictor). Yet as is stated in Eaxmple 3 in the ?Results documentation:

"this tests if the condition effect is different in III compared to I". I don't think that this is what I want. I am not interested if the relationship (slope) of, say, OTU_1 with the continuous predictor differs in Habitat_2 compared to the reference habitat 1. I am interested which OTUs co-vary with the continuous predictor - conditional on habitat.

Therefor I think it would be better to split the data by habitat and run 4 models independently. Would you agree? I was thinking that turning of independent filtering, recording all the p-values, and then perform p-value adjustment with independent filtering on the joint pvalues. Would that make sense? Thanks a lot for your support!


ADD COMMENTlink modified 11 days ago • written 12 days ago by fabian.roger0
gravatar for Michael Love
12 days ago by
Michael Love13k
United States
Michael Love13k wrote:

"I am interested which OTUs co-vary with the continuous predictor - conditional on habitat"

Do you mean, "controlling for habitat differences"?

If so, you can use ~habitat + predictor. 

ADD COMMENTlink written 12 days ago by Michael Love13k

thanks for coming back to me!

would your model not only account for the main effect of habitat (i.e. different mean abundance?). I hypothesise that any OTU that covaries with the continuous predictor will only do so in some habitats but not in others (where it might not even be present). Sorry if I am missing the obvious.



ADD REPLYlink written 11 days ago by fabian.roger0

Oh I didn't understand the question at first. You should use a design of ~Habitat + Habitat:continuous_predictor, which will give a different slope for each habitat.

ADD REPLYlink written 10 days ago by Michael Love13k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 122 users visited in the last hour