Question: How to model.matrix and makeContrasts for several groups with multiple treatments in limma?
0
8.3 years ago by
Ou, Jianhong1.1k
United States
Ou, Jianhong1.1k wrote:
Hi groups, Suppose that the experiment has three cell-lines: c1, c2, c3 and three treatments: t1, t2, t3 The targets frame: ---------------------------------------------- filename cell_line treatment ---------------------------------------------- filename1 c1 t1 filename2 c2 t1 filename3 c3 t1 filename4 c1 t2 filename5 c2 t2 filename6 c3 t2 filename7 c1 t3 filename8 c2 t3 filename9 c3 t3 ----------------------------------------------- targets<-readTargets("targets.txt",sep=" ",row.names="fileneame") What is the difference among: 1. design<-model.matrix(~-1+factor(targets$cell_line)+factor(targets$t reatment)) 2. design<-model.matrix(~-1+factor(targets$treatment)+factor(targets$c ell_line)) 3. design<-model.matrix(~factor(targets$cell_line)+factor(targets$trea tment)) 4. design<-model.matrix(~factor(targets$treatment)+factor(targets$cell _line)) and how could I make contrasts if I want to compare the difference among the treatments? Thanks a lots. Yours sincerely, Jianhong Ou jianhong.ou@umassmed.edu<mailto:jianhong.ou@umassmed.edu> [[alternative HTML version deleted]]
• 1.9k views
modified 8.3 years ago by Naomi Altman6.0k • written 8.3 years ago by Ou, Jianhong1.1k
Answer: How to model.matrix and makeContrasts for several groups with multiple treatment
0
8.3 years ago by
Naomi Altman6.0k
Naomi Altman6.0k wrote:
Dear Jianhong, The order in which you put the factors in the model does not matter. However, the -1 does matter if you do not want to use contrasts. If you are using contrasts, then any of the 4 designs will work fine. The best way to see the difference is to print the design matrix. If you are only interested in pairwise differences among the treatments the contrasts are t1-t2 t1-t3 t2-t3 In that case you are using the cell lines are blocking variables, which is probably what is required. At 01:07 PM 3/11/2011, Ou, Jianhong wrote: >Hi groups, > >Suppose that the experiment has three cell-lines: c1, c2, c3 > and three > treatments: t1, t2, t3 > >The targets frame: > >---------------------------------------------- >filename cell_line treatment >---------------------------------------------- >filename1 c1 t1 >filename2 c2 t1 >filename3 c3 t1 >filename4 c1 t2 >filename5 c2 t2 >filename6 c3 t2 >filename7 c1 t3 >filename8 c2 t3 >filename9 c3 t3 >----------------------------------------------- > > >targets<-readTargets("targets.txt",sep=" ",row.names="fileneame") > >What is the difference among: > >1. >design<-model.matrix(~-1+factor(targets$cell_line)+factor(targets$tre atment)) >2. >design<-model.matrix(~-1+factor(targets$treatment)+factor(targets$cel l_line)) >3. design<-model.matrix(~factor(targets$cell_line)+factor(targets$tre atment)) >4. design<-model.matrix(~factor(targets$treatment)+factor(targets$cel l_line)) > >and how could I make contrasts if I want to compare the difference >among the treatments? > >Thanks a lots. > >Yours sincerely, > >Jianhong Ou > >jianhong.ou at umassmed.edu<mailto:jianhong.ou at="" umassmed.edu=""> > > > > [[alternative HTML version deleted]] > >_______________________________________________ >Bioconductor mailing list >Bioconductor at r-project.org >https://stat.ethz.ch/mailman/listinfo/bioconductor >Search the archives: >http://news.gmane.org/gmane.science.biology.informatics.conductor