[BioC] How to model.matrix and makeContrasts for several groups with multiple treatments in limma?

Naomi Altman naomi at stat.psu.edu
Fri Mar 11 22:31:12 CET 2011


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$treatment))
>2. 
>design<-model.matrix(~-1+factor(targets$treatment)+factor(targets$cell_line))
>3. design<-model.matrix(~factor(targets$cell_line)+factor(targets$treatment))
>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 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



More information about the Bioconductor mailing list