[R-sig-ME] Question on mixed model design to analyze microarray data

Ben Bolker bbolker at gmail.com
Sat Jun 29 17:57:53 CEST 2013


Tom Wenseleers <Tom.Wenseleers at ...> writes:

> 
> Dear all,
> I was just trying to analyse some microarray gene expression
> data using mixed models in R.
> Based on the SAS code given here
> http://support.sas.com/documentation/cdl/en/
> statug/63033/HTML/default/viewer.htm#statug_hpmixed_sect035.htm

 (URL broken, sorry)

>    proc hpmixed data=microarray;
>       class marray dye trt gene pin dip;
>       model log2i = dye trt gene dye*gene trt*gene pin;
>       random marray marray*gene dip(marray) pin*marray;
>       test trt;
>    run;
> 
> I wanted to try to run the equivalent model in 
> R using lmer and then test significance using lmerTest and/or
> lsmeans. Am I correct that the correct syntax would
> be
> lmer(log2i~dye+trt+gene+dye:gene+trt:gene+pin+(1|marray)+
> (gene|marray)+(1|marray/dip)+(pin|marray), data=microarray)
> (gene has about 10 000 levels and marray 10, would this run in lmer?)

  I think you probably want a random effect of 

(1|marray) + (1|marray:gene) + (1|marray:pin)+(1|marray:dip)

or equivalently

(1|marray/gene) + (1|marray:pin) + (1|marray:dip)

 you almost certainly _don't_ want (gene|marray), which will try
to fit correlations among gene effects by microarray (i.e a 10K by 10K
correlation matrix), which will explode your computer.  At a quick
read I'm not quite sure what distinction the SAS authors are making
between "X by Y" and "X within Y": I would code "X by Y" as
(1|X) + (1|Y) + (1|X:Y)  [ (1|X*Y) might work, but I haven't tried it ]
and "X within Y" as (1|Y/X) or (1|Y) + (1|Y:X)
> 
> Also, would it be possible in any way to allow 
> variances across treatment (trt) groups to be unequal? Or is
> that only possible in nlme/lme?
> (but that wouldn't allow for such complex random effect designs, right?)

  Not at present in lmer.  You might be able to code these
random effects in nlme (see the relevant pages of Pinheiro &
Bates 2000, referenced in http://glmm.wikidot.com/faq under
"Crossed random effects", but lme4 is likely to be a lot faster.



More information about the R-sig-mixed-models mailing list