How to ask limma to allow different variances for different treatment arms
2
1
Entering edit mode
ML18 ▴ 10
@ml18-15258
Last seen 21 months ago

In limma paper in 2015 (https://academic.oup.com/nar/article/43/7/e47/2414268), it stated that it accommodates unequal variances of different treatment arms through two ways under the section titled "Variance models allow for unequal variability". My question is that should we assume Limma deals with unequal variability automatically or should we set some parameter(s) based on estimation using our data? Is there any example if it's the latter case?

Thanks!

limma treatment variance • 220 views
0
Entering edit mode

I've edited the title of your question because you already know that limma does not require equal variances. The question is what limma does by default and how different group variances should be requested is desired.

2
Entering edit mode
@gordon-smyth
Last seen 9 hours ago
WEHI, Melbourne, Australia

Suppose you have two or more treatment groups specified by a factor group:

design <- model.matrix(~group)


If you are not using voom weights, then you can tell limma to allow different variabilities for the treatment groups using arrayWeights:

w <- arrayWeights(y, design, var.group=group)
fit <- lmFit(y, design, weights=w)


etc.

If you are using voom, then var.group is specified as part of the voomWithQualityWeights call:

v <- voomWithQualityWeights(y, design, var.group=group)
fit <- lmFit(v, design)


etc.

0
Entering edit mode

1
Entering edit mode
@james-w-macdonald-5106
Last seen 1 hour ago
United States

Quoting liberally from that paper:

The use of weights and the ability to model global parameters allow limma to incorporate unequal variances in a number of ways. One way is through estimating a mean-variance trend, which can either be incorporated into the empirical Bayes procedure as mentioned above or used to generate observation weights (10). A recent development is the ability to estimate precision weights associated with treatment groups or more generally with any given set of covariates. More generally again, the mean-variance trend can be estimated in a treatment-specific way, combining the two types of heteroscedasticity mentioned above.

The mean-variance trend is available as part of eBayes as one might imagine from reading that it can 'be incorporated into the empirical Bayes procedure'. From ?eBayes:

   trend: logical, should an intensity-trend be allowed for the prior
variance? Default is that the prior variance is constant.


As for the precision weights, see ?arrayWeights