[Bioc-sig-seq] edgeR glmLRT contrast Argument

Gordon K Smyth smyth at wehi.EDU.AU
Thu Sep 1 00:51:01 CEST 2011

Dear Dario,

Here's an example.  Suppose you have three groups and you want to make 
pairwise comparisons between them.

   group <- factor(c(1,1,2,2,3,3))
   design <- model.matrix(~group)
   fit <- glmFit(y,design,etc)

The fit has three parameters.  The first is the baseline level of group 1. 
The second and third are the 2vs1 and 3vs1 differences.

To compare 2 vs 1:

   lrt.2vs1 <- glmFit(y,fit,coef=2)

To compare 3 vs 1:

   lrt.3vs1 <- glmFit(y,fit,coef=3)

To compare 3 vs 2:

   lrt.3vs2 <- glmFit(y,fit,contrast=c(0,-1,1))

The constrast argument says you want to test coef3-coef2 equal to zero.

Best wishes

> Date: Wed, 31 Aug 2011 10:00:33 +1000 (EST)
> From: Dario Strbenac <D.Strbenac at garvan.org.au>
> To: bioc-sig-sequencing at r-project.org
> Subject: [Bioc-sig-seq] edgeR glmLRT contrast Argument
> Message-ID: <20110831100033.BMS26888 at gimr.garvan.unsw.edu.au>
> Content-Type: text/plain; charset=us-ascii
> Good morning,
> I'm looking for examples of what types of use cases the contrast 
> argument is used for. I'm not sure what are the cases when the argument 
> coef will not be enough, and when I will need to use it.
> Thank you.
> --------------------------------------
> Dario Strbenac
> Research Assistant
> Cancer Epigenetics
> Garvan Institute of Medical Research
> Darlinghurst NSW 2010
> Australia

The information in this email is confidential and intend...{{dropped:4}}

More information about the Bioc-sig-sequencing mailing list