[R-sig-ME] random effect syntax

John.Morrongiello at csiro.au John.Morrongiello at csiro.au
Thu Feb 14 06:10:31 CET 2013


Hi list

I was wondering if someone could explain to me the difference between two models in terms of their random effect structure? We have a datatset of repeated growth observations within 400 individuals (ID) from three sites. The growth of these individuals corresponds to different years and is thus a crossed random effect with ID. As we only have three sites, we are not treating it as a random effect, although we'd like to test whether the year-to-year growth variation is dependent on the site it comes from. We'd also like to test whether the growth~age relationship varies among years. Hence we have fit the following models:

M1<-lmer(growth~Age*site+(Age|ID)+(Age+site|Year))
M2<-lmer(growth~age*site+(Age|ID)+(Age|site:Year))

I think that M2 is maybe nesting Year within site, whereas M1 is just allowing for by year adjustments to each site, but I'm not sure! Below is the random effects tables from the two models. 

*Random effects output from M1:
AIC BIC logLik deviance REMLdev
 105 322  -16.4     -139    32.8
Random effects:
 Groups   Name         Variance Std.Dev. Corr               
 FishID   (Intercept)  0.012636 0.1124                      
          c.(log(age)) 0.016178 0.1272   -0.052             
 fYear    (Intercept)  0.000234 0.0153                      
          c.(log(age)) 0.011124 0.1055   0.494              
          sitehcr      0.006363 0.0798   0.546  0.998       
          sitepb       0.005130 0.0716   0.755  0.943 0.962 
 Residual              0.044675 0.2114                      
Number of obs: 3115, groups: FishID, 392; fYear, 21

*Random effects output from M2:
AIC BIC logLik deviance REMLdev
 133 308  -37.6    -87.4    75.1
Random effects:
 Groups     Name         Variance Std.Dev. Corr   
 FishID     (Intercept)  0.01249  0.1117          
            c.(log(age)) 0.01641  0.1281   -0.058 
 site:fYear (Intercept)  0.00314  0.0560          
            c.(log(age)) 0.00979  0.0989   0.826  
 Residual                0.04478  0.2116          
Number of obs: 3115, groups: FishID, 392; site:fYear, 57

When I print the random effects, I get different values. For M1, there is a random intercept for each year and a corresponding 'adjustment' for each site. When plotted, there is very little difference among years for each site. For M2, I get a unique intercept for each year by site combination. When plotted, these show considerable among-site variation through time (which I think is a better reflection of the underlying data). However, a likelihood ratio test prefers M1, so a bit confused.

Thank you for your time

John



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