Dear all,
I have a complex design for limma-voom with paired samples and 3 factors:
ID |
INDIVIDUAL |
TREATMENT |
GROUP |
RESPONSE |
1 |
1 |
Pre |
A |
Good |
2 |
1 |
Post |
A |
Good |
3 |
2 |
Pre |
A |
Good |
4 |
2 |
Post |
A |
Good |
5 |
3 |
Pre |
A |
Good |
6 |
3 |
Post |
A |
Good |
7 |
4 |
Pre |
B |
Good |
8 |
4 |
Post |
B |
Good |
9 |
5 |
Pre |
B |
Bad |
10 |
5 |
Post |
B |
Bad |
11 |
6 |
Pre |
A |
Bad |
12 |
6 |
Post |
A |
Bad |
13 |
7 |
Pre |
A |
Good |
14 |
7 |
Post |
A |
Good |
15 |
8 |
Pre |
A |
Bad |
16 |
8 |
Post |
A |
Bad |
17 |
9 |
Pre |
B |
Good |
18 |
9 |
Post |
B |
Good |
19 |
10 |
Pre |
A |
Good |
20 |
10 |
Post |
A |
Good |
I need both within and between patients comparisons so I am using the limma 'duplicateCorrelation' function.
The problem is that I am a bit confused to extract coefficients for these multiple comparisons:
1.a) Pre : Group A vs Group B
1.b) Post: Group A vs Group B
2.a) Group A : Pre vs Post
2.b) Group B: Pre vs Post
3.a) Pre, Group A : Good vs Bad
3.b) Pre, Group B : Good vs Bad
4.a) Post, Group A: Good vs Bad
4.b) Post, Group B: Good vs Bad
5.a) Good, Group A: Pre vs Post
5.b) Good, Group B: Pre vs Post
6.a) Bad, Group A: Pre vs Post
6.b) Bad, Group B: Pre vs Post
Here the code:
TREATMENT=as.factor(info$TREATMENT) GROUP=as.factor(info$GROUP) RESPONSE=as.factor(info$RESPONSE) INDIVIDUAL=as.factor(info$INDIVIDUAL) design=model.matrix(~0+TREATMENT+GROUP+RESPONSE) v=voom(y,design) cor=duplicateCorrelation(v,design,block=INDIVIDUAL) fit=lmFit(v,design,block=INDIVIDUAL, correlation=cor$consensus)
How can I extract the desired coefficients with this model ?
Split the tags for limma and
voom
, otherwise people won't get notified.