This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Additive Models in edgeR

In the edgeR vignette, they mention additive models when dealing with paired samples. So if this was our design:

data.frame(Subject = rep(c(1,2,3), each = 2), Treatment = rep(c("C","F"), 3))
  Subject Treatment

1       1         C
2       1         T
3       2         C
4       2         T
5       3         C
6       3         T

And if we wanted to look at the effects of treatment, while adjusting for the subject, the model matrix would look like this:

  model.matrix(~Subject + Treatment)

Does this also apply for when we want to adjust for another variable? Let's say we have treatment (not paired) and gender as such:

  Samples   Treatment   Gender
Sample_1    Control     M
Sample_2    Control     M
Sample_3    Control     M
Sample_4    Treatment   M
Sample_5    Treatment   M
Sample_6    Treatment   M
Sample_7    Control     F
Sample_8    Control     F
Sample_9    Control     F
Sample_10   Treatment   F
Sample_11   Treatment   F
Sample_12   Treatment   F

Would a model matrix like this using the additive model adjust for gender?

model.matrix(~Gender + Treatment)
edger

You have no females receiving the treatment so it makes no sense here.

I think the data is not representative of reality (it's just a random assortment of component variables) - the OP probably didn't ensure it held up as a model dataset.

Thanks you two. Yes, Ram is correct, it was a very poorly created example that should’ve been double-checked. I removed it from my post. My real world data-set has equal numbers of male and females receiving a treatment or in a control group and they are not paired (ie, one subject in only one group.)

You can show a manipulated version of your previous dataset without the data frame generation logic. The generation logic is what let you down.

0 answers

No answers yet.

Log in to answer this question.