# [BioC] Odd contrast; does it make statistical sense?

Gordon K Smyth smyth at wehi.EDU.AU
Fri Jan 24 00:48:42 CET 2014

```Hi Ryan,

Your contrast doesn't seem so odd to me.  We used a similar contrast for
example to compare Basal breast cancer with the average of all other
breast cancer subtypes:

http://nar.oxfordjournals.org/content/40/17/e133

> Date: Wed, 22 Jan 2014 16:17:35 -0800
> From: "Ryan C. Thompson" <rct at thompsonclan.org>
> To: bioconductor <Bioconductor at r-project.org>
> Subject: [BioC] Odd contrast; does it make statistical sense?
>
> Hi all,
>
> I'm currently using edgeR to test a somewhat odd contrast. Basically, I
> have multiple groups, and I want to combine them into just 2 big groups
> and test whether the two big groups have significantly different
> averages. I'll give a toy example that demonstrates the same concept. In
> this example, there are 4 groups, A through D, each containing 3
> samples, and I want to test whether the mean of all samples in A & B is
> different from the mean of all samples in C & D:
>
> group <- rep(LETTERS[1:4], 3)
> design <- model.matrix(~0+group)
> colnames(design) <- LETTERS[1:4]
> cont <- makeContrasts((A+B)/2 - (C+D)/2, levels=design)
>
> My worry is that with this contrast, I'm effectively just testing two
> groups against each other, and by having 4 groups in the design I will
> be estimating dispersions that are not appropriate for the test that I'm
> doing, and hence I will overstate my confidence.

The dispersions remain unchanged regardless of the contrast you test.
The dispersions have been estimated after removing all differences between
the four groups, i.e., without bias.

edgeR is giving you a correct test of the contrast you have specified.
You are testing whether an equal mix of the first two groups has the same
average expression as an equal mix of the third and fourth groups.

Note that you are not testing whether the difference between the two big
groups is large compared to variation within the big groups.  The test
does not care how large the differences are between A and B, or between C
and D.

> Or, to put it another way, am I doing something equivalent to testing a
> main effect in a model where an interaction term is present?

No, the test does not suffer from the same objection.  However you may
need to be careful interpreting the test when there is lots of DE between
A vs B or C vd D.  It may be worthwhile first checking A vs B and C vs D.

Best wishes
Gordon

> Thank you,
>
> -Ryan Thompson

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

```