[R-sig-ME] lme: random effect nested within fixed effect

Daniel Ezra Johnson danielezrajohnson at gmail.com
Tue Apr 6 23:36:35 CEST 2010


Take the classic example of students nested within schools. And the  
fixed effect of interest might be two different versions of a test.

Are people saying that if the effect of interest was instead school,  
and school was made a fixed effect, that you would stop saying  
students are "nested" within school?

To me it's a valuable term. A random effect can nest in, or be crossed  
with, a fixed effect.

Dan

On Apr 6, 2010, at 4:54 PM, Ben Bolker <bolker at ufl.edu> wrote:

>  in general "nested" is used to apply to the relationship between
> random effects, not to the relationship between fixed & random effects
> -- the relationship between random (population) and fixed (type) would
> actually be an interaction between random and fixed.
>
>  I'm still not 100% sure of the meaning of the design, but I would
> strongly consider whether simply pooling (i.e., taking means) of
> individuals within populations would make sense -- there's a nice  
> paper
> by Murtaugh (2009) in Ecology or Ecological Applications that makes  
> this
> point.  Then you wouldn't have to mess with mixed models at all, you
> would just have 'populations' as your sample points.
>
> Andrew Dolman wrote:
>> I wouldn't consider population to be nested within type or type to  
>> be a
>> random effect. You've measured growth of individuals of three  
>> different
>> types (a fixed effect) and the individuals were grouped in  
>> populations so
>> perhaps should not be considered totally independent data points.  
>> The random
>> structure ~ 1 | population  reflects this sampling structure.
>>
>> Andy.
>>
>> andydolman at gmail.com
>>
>>
>> On 6 April 2010 21:24, Itay Mayrose <itaymay at gmail.com> wrote:
>>
>>> thanks Andy!
>>>
>>> what I am a bit confused about is that I am not sure how does this  
>>> account
>>> for population nested within type so I thought the second option  
>>> is the most
>>> sensible:
>>>
>>>
>>> z1 <- lme(growth ~ type, random = ~ 1 | type/population, data =
>>> times,method="ML")
>>>
>>> itay
>>>
>>>
>>>
>>> On Tue, Apr 6, 2010 at 12:13 PM, Andrew Dolman  
>>> <andydolman at gmail.com>wrote:
>>>
>>>> Hi Itay,
>>>>
>>>> I think what you want is the following.
>>>>
>>>>
>>>> z0 <- lme(growth ~ 1,     random = ~ 1 | population, data =
>>>> times,method="ML")
>>>>
>>>>
>>>> z1 <- lme(growth ~ type, random = ~ 1 | population, data =
>>>> times,method="ML")
>>>>
>>>> anova(z0,z1)
>>>>
>>>>
>>>> This tests for differences in growth between plant types while  
>>>> allowing
>>>> growth rates to vary randomly between populations - or to look at  
>>>> it a
>>>> different way, it accounts for individuals within populations  
>>>> being more
>>>> similar to each other on average than individuals from different
>>>> populations.
>>>>
>>>>
>>>> A construction like this
>>>>
>>>> z1 <- lme(growth ~ type, random = ~ type | population, data =
>>>> times,method="ML")
>>>>
>>>> allows the difference in growth between plant types to vary  
>>>> randomly
>>>> between populations. But this would only makes sense if different  
>>>> plant
>>>> types existed in the same populations, which does not sound to be  
>>>> the case
>>>> here, and is asking a different question.
>>>>
>>>>
>>>>
>>>> Andy.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> andydolman at gmail.com
>>>>
>>>>
>>>> On 6 April 2010 20:45, Itay Mayrose <itaymay at gmail.com> wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> This should be a somewhat trivial question but I am new to R and  
>>>>> I am a
>>>>> bit
>>>>> puzzled with the lme syntax.
>>>>>
>>>>> I would like to test for growth difference between three types of
>>>>> plants.
>>>>> For each plant type I randomly sampled four populations and for  
>>>>> each
>>>>> population several individuals.
>>>>>
>>>>> First, I used lme where type is the fixed effect and population is
>>>>> random
>>>>> nested within type, but I am not sure which of the three options  
>>>>> the
>>>>> correct
>>>>> syntax is:
>>>>>
>>>>> (1)
>>>>>
>>>>> z1 <- lme(growth ~ type, random = ~ 1 | population, data =
>>>>> times,method="ML")
>>>>>
>>>>> (2)
>>>>>
>>>>> z1 <- lme(growth ~ type, random = ~ 1 | type/population, data =
>>>>> times,method="ML")
>>>>>
>>>>> (3)
>>>>>
>>>>> z1 <- lme(growth ~ type, random = ~ type | population, data =
>>>>> times,method="ML")
>>>>>
>>>>>
>>>>>
>>>>> I am using the ML method because I would like to contrast this  
>>>>> model
>>>>> against
>>>>> a NULL model where growth does not depend on plant type  
>>>>> (assuming the
>>>>> first
>>>>> syntax is correct):
>>>>>
>>>>> z0 <- lme(growth ~ 1, random = ~ type | population, data =
>>>>> times,method="ML")
>>>>>
>>>>> anova(z0,z1)
>>>>>
>>>>>
>>>>>
>>>>> Thanks!
>>>>> Khilik
>>>>>
>>>>>       [[alternative HTML version deleted]]
>>>>>
>>>>> _______________________________________________
>>>>> R-sig-mixed-models at r-project.org mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>>>
>>>>
>>>
>>> --
>>> _________________________________
>>> Itay Mayrose
>>> http://www.zoology.ubc.ca/~mayrose/<http://www.zoology.ubc.ca/%7Emayrose/ 
>>> >
>>> Department of Zoology,
>>> University of British Columbia
>>> email: itaymay at gmail.com
>>>
>>
>>    [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>
> -- 
> Ben Bolker
> Associate professor, Biology Dep't, Univ. of Florida
> bolker at ufl.edu / people.biology.ufl.edu/bolker
> GPG key: people.biology.ufl.edu/bolker/benbolker-publickey.asc
>
> _______________________________________________
> 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