This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Model matrix confront 2 groups out of 3

I am having difficulty understanding the comparison between conditions in the design formula created for an analysis with DRIMSeq.

Basically, I have 3 conditions: Healthy, Not_healthy1, Not_healthy2. My purpose is to feed the model comparing Healthy vs Not_healthy1 and Healthy vs Not_healthy2 (separately), but I am confused about the design formula. I created it with the following code, with -1 indicating no intercept:

design_full <- model.matrix(~ -1 + condition, data=DRIMSeq::samples(d))

The design formula is this one:

    Not_healthy1    Not_healthy2    Healthy
 P1     1               0              0
 P2     1               0              0
 P3     0               0              1 
 P4     1               0              0

The next step for the analysis will be this one:

 set.seed(1)
 system.time({
    d <- dmPrecision(d, design=design_full)
    d <- dmFit(d, design=design_full)
    d <- dmTest(d, coef="Healthy") 
  })

How can I set as baseline the condition Healthy and compare that to the others exclusively ? I think that in this way I am comparing Healthy versus al the others, that is not correct for my purposes.

modelmatrix r designformula deseq2 drimseq

I don't know the DRIMseq package, but basically you have two options. Either use a design without intercept (~0+group) and then use contrasts or with an intercept and make sure that group is a factor and the reference level is the group level you want to compare against.

0 answers

No answers yet.

Log in to answer this question.