[R-sig-ME] Clarification of lme random effects syntax

Ben Bolker bbolker at gmail.com
Sat Jul 27 22:21:12 CEST 2013


AvianResearchDivision <segerfan83 at ...> writes:

> 
> Hi all,
> 
> I am looking for some clarification in the syntax of the random effects
> found in a mixed model written in 'lme'.  I have determined that I need
> both random intercepts (longitudinal data) and random slopes (investigation
> of lattice plots and preliminary model fitting) for a model I'm working
> on.  However, where I am unclear is whether to write the fixed effects as:
> 
> Option A:  random=~MeanUrban|Male
> 
> Option B:  random=~1+MeanUrban|Male
> 
> Option C:  random=list(~1|Male, ~0+MeanUrban|Male)
> 
> Option D:  random=list(~1|Male, ~MeanUrban-1|Male)
> 
> I know this has to do with correlated random effects and part of that
> decision is made by visual inspection of the raw data, but part of it has
> to be based on some sort of quantitative conclusion based on the results of
> the models.  Please advise of how to proceed.  Thank you for your time.

A and B are identical.  So are C and D.

You could do a likelihood ratio test or use AIC to try to decide
whether to incorporate a correlation between intercept and slope
across individuals, with the usual caveats (neither approach
accounts for finite-size effects, nor boundary effects: see
http://glmm.wikidot.com/faq ).



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