Entering edit mode
3.3 years ago
bioinformatics2020
▴
820
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)