Skip to content

how to test the random factor effect in lme

3 messages · Xiang Gao, David Winsemius, Greg Snow

#
Hi

I am working on a Nested one-way ANOVA. I don't know how to implement
R code to test the significance of the random factor

My R code so far can only test the fixed factor :

anova(lme(PCB~Area,random=~1|Sites, data = PCBdata))
            numDF denDF   F-value p-value
(Intercept)     1    12 1841.7845  <.0001
Area              1     4    4.9846  0.0894


Here is my data and my hand calculation.
Area Sites PCB
1     A     1  18
2     A     1  16
3     A     1  16
4     A     2  19
5     A     2  20
6     A     2  19
7     A     3  18
8     A     3  18
9     A     3  20
10    B     4  21
11    B     4  20
12    B     4  18
13    B     5  19
14    B     5  20
15    B     5  21
16    B     6  19
17    B     6  23
18    B     6  21

By hand calculation, the result should be:
Source	SS	DF	MS
Areas      18.00  1    18.00
Sites        14.44  4    3.61
Error        20.67  12  1.72
Total	        53.11   17   ---


MSareas/MSsites = 4.99 --- matching the R output
MSsites/MSE = 2.10
Conclusion is that Neither of Areas nor Sites make differences.


My R code so far can only test the fixed effect :

anova(lme(PCB~Area,random=~1|Sites, data = PCBdata))
            numDF denDF   F-value p-value
(Intercept)     1    12 1841.7845  <.0001
Area              1     4    4.9846  0.0894
#
On Feb 14, 2012, at 5:36 PM, Xiang Gao wrote:

            
Have you read what the unofficial Mixed Model FAQ says about testing  
for significance on random effects?

http://glmm.wikidot.com/faq
That may be the intent of the authors. They may want to make it  
sufficiently  difficult so that an adequate barrier prevents the  
unwary from taking some "easy way out". You probably need to describe  
your study (assuming this is not an assigned homework exercise) in  
sufficient scientific detail and do so on the mixed-models mailing list.
#
This post https://stat.ethz.ch/pipermail/r-sig-mixed-models/2009q1/001819.html
may help you understand why the standard p-values in some cases are
not the right thing to do and what one alternative is.
On Tue, Feb 14, 2012 at 3:36 PM, Xiang Gao <xianggao2006 at gmail.com> wrote: