[R] Using R for microarrays datas analysis by Mixed model ANOVA. lme function.

Ramon Diaz-Uriarte rdiaz at cnio.es
Fri Sep 12 11:12:14 CEST 2003

Dear Daphne,

A couple of further comments:

On Thursday 11 September 2003 22:05, Spencer Graves wrote:
> 1.  Have you consulted Pinhiero and Bates (2000) Mixed-Effects Models in
> S and S-Plus (Springer)?  This is the standard (almost indispensible)
> reference on "lme".
> 2.  Are you familiar with the Bioconductor project
> (www.bioconductor.org)?  The have a substantial library of software for
> analyzing microarray data.
> hope this helps.  spencer graves
> Daphne Autran wrote:
> > Hi,
> > We are using R to analyse microarrays datas by ANOVA.
> > We would like to set up Mixed Model analysis, using the "lme" function
> > within the nmle package.
> > However, we have problem in understanding and getting the right formula
> > to build a "groupedData" object which appear to be required for lme to
> > work. 

No, not really. You can use lme without a groupedData object. For instance:

y <- rnorm(20)
x <- rnorm(20)
u <- factor(c(rep("a", 10), rep("b", 10)))

lme(y ~ x, random = ~ 1|u)

A simple minded approach is to call lme repeatedly using apply over your array 
of genes*subjects. Suppose you have:

microarray.data <- matrix(rnorm(200), ncol = 20) ## genes in rows

## using x and u as defined above
apply(microarray.data, 1, function(z) lme(z ~ x, random = ~1|u))

The above, of course, gives you a lot of output, in a not particularly 
organized form. You can access the components of the lme fitted object, or 
its summary, or whatever, and get only what you want, and place it in, say, a 

f1 <- function(z) {
    summary(lme(z ~ x, random = ~1|u))$t[2, ]

gene.t.tables <- t(apply(microarray.data, 1, function(z) f1(z)))


As Spencer said, you probably want a copy of Pinheiro and Bates. Venables & 
Ripleys's MASS also discusses lme.

> >
> > Does anybody have an experience in using this function for microarrays
> > datas analysis and could send me informations or, if possible, a resolved
> > exemple (input table of datas, formula of the model, ouput...) ?
> >
> > Maybe other R functions are usefull and easier to implement Mixed Models
> > ANOVA for microarrays analysis, any suggestions ?

The package limma, in bioconductor, is ideal for fitting linear models. It 
does not include mixed effects models, though. 

Hope this helps,


Ramón Díaz-Uriarte
Bioinformatics Unit
Centro Nacional de Investigaciones Oncológicas (CNIO)
(Spanish National Cancer Center)
Melchor Fernández Almagro, 3
28029 Madrid (Spain)
Fax: +-34-91-224-6972
Phone: +-34-91-224-6900


More information about the R-help mailing list