[R-sig-ME] comparing 3 levels of fixed factor in lme4

John Maindonald john.maindonald at anu.edu.au
Mon Jul 30 14:02:42 CEST 2012


Well, you can use the t-statistics for comparison-wise tests!
the issue is whether one ought to do this, or whether one
should do some kind of overall test.  As I see it, all depends 
on the purpose that is in mind.

As Professor Dalgaard says, the issue is much the same as 
for lm models.  

You can for example do:

> library(DAAG)
> a1 <- lme(ShootDryMass ~ fert+variety, random=~1|Block, data=rice)
> anova(a1)
            numDF denDF F-value p-value
(Intercept)     1    67   72.39  <.0001
fert            2    67    3.94  0.0241
variety         1    67   25.48  <.0001

As the design is balanced, the order of terms does not affect the anova F-test.
But as the design is balanced, you be better to do:
> rice.aov <- aov(ShootDryMass ~ fert+variety+Error(Block), data=rice)
> summary(rice.aov)

Error: Block
          Df Sum Sq Mean Sq F value Pr(>F)
Residuals  1   3528    3528               

Error: Within
          Df Sum Sq Mean Sq F value  Pr(>F)
fert       2   7019    3509    3.94   0.024
variety    1  22685   22685   25.48 3.7e-06
Residuals 67  59657     890                

John Maindonald             email: john.maindonald at anu.edu.au
phone : +61 2 (6125)3473    fax  : +61 2(6125)5549
Centre for Mathematics & Its Applications, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.
http://www.maths.anu.edu.au/~johnm

On 30/07/2012, at 9:38 PM, Obermeier Andrew wrote:

> Thank you John Maindonald.
> 
> For more than 2 levels of the experimental condition, I learned that usually we find an F to test mean differences across the levels of the condition.
> 
> In lme4, the model summary reports a t value, and I am replicating a study that uses lme4 to compare 3 levels of a fixed factor. My advising professor has told me that the t value can only be used to compare 2 means.
> 
> Andrew Obermeier
> 
> 
> 
> 
> On Jul 30, 2012, at 8:00 PM, John Maindonald <john.maindonald at anu.edu.au> wrote:
> 
>> Perhaps Andrew has vaguely at the back of his mind the notion
>> that for comparing >2 means, one should be using a multiple
>> range test or an anova test, at all events if the aim is to achieve
>> an experiment-wise 5% level.  Tests based on the individual
>> t-statistics are not independent.  This is of course a somewhat
>> controversial area.  
>> John Maindonald             email: john.maindonald at anu.edu.au
>> phone : +61 2 (6125)3473    fax  : +61 2(6125)5549
>> Centre for Mathematics & Its Applications, Room 1194,
>> John Dedman Mathematical Sciences Building (Building 27)
>> Australian National University, Canberra ACT 0200.
>> http://www.maths.anu.edu.au/~johnm
>> 
>> On 30/07/2012, at 8:38 PM, peter dalgaard wrote:
>> 
>>> 
>>> On Jul 30, 2012, at 08:04 , Obermeier Andrew wrote:
>>> 
>>>> In lme4, in models with 3 levels of the fixed factor, each of these gets a t value comparing it to a reference level.
>>>> 
>>>> How is this done? 
>>>> 
>>>> It is my understanding that the t value can only be used to compare 2 means.
>>>> 
>>> 
>>> Then your understanding is wrong, and you need to read a text on basic linear modelling theory. Nothing specifically mixed-model or even R relevant about that.
>>> 
>>> -- 
>>> Peter Dalgaard, Professor,
>>> Center for Statistics, Copenhagen Business School
>>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
>>> Phone: (+45)38153501
>>> Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com
>>> 
>>> _______________________________________________
>>> R-sig-mixed-models at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>> 
> 



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