Skip to content

confidence intervals in lmer

2 messages · Rachel Cohen, Jonathan Baron

#
Hi, I am trying to get the 95% confidence intervals for the coefficients 
in the lmer model below.

mod5<-lmer((centre.log.mass)~centre.log.dbh+centre.log.height+(1+centre.log.height|species_site),data=data3,REML=F) 


I have tried to use the function ci(mod5) but get the following error 
message:
Error in .local(object, n, verbose, ...) :
   Code for non-trivial theta_T not yet written

However, the function works when I alter my model as below:
mod6<-lmer((centre.log.mass)~centre.log.dbh+centre.log.height+(1|species_site)+(0+centre.log.height|species_site),data=data3,REML=F) 


I'm not sure this what this altered model means, (i.e. why are random 
effects terms different, i'm still allowing both the intercept and the 
slope of height to vary by group?) but the model output is different 
from my original model.  The coefficients are different and I seem to 
now have eliminated any correlation between the slope and intercept. 
Which I'm thinking was the reason why the ci function wouldn't work in 
the first place?

Mod 6 output
Random effects:
  Groups       Name              Variance Std.Dev.
  species_site (Intercept)       2.32117  1.52354
  species_site centre.log.height 0.47887  0.69200
  Residual                       0.10036  0.31679
Number of obs: 302, groups: species_site, 12

Fixed effects:
                   Estimate Std. Error t value
(Intercept)       -0.47716    0.44829  -1.064
centre.log.dbh     1.68772    0.07536  22.396
centre.log.height  0.67887    0.24345   2.789

Correlation of Fixed Effects:
             (Intr) cntr.lg.d
cntr.lg.dbh  0.026
cntr.lg.hgh  0.028 -0.302

Any help in understanding whats going on would be great!

Regards,

Rachel
#
Rachel,

I think you have understood quite well.  The second expression
_assumes_ no correlation between the random effects.  The same thing
happens with pvals.fnc() in the languageR package, I think because
mcmcsamp (in the lme4 package) cannot deal with correlated random
effects.

There has been some discussion of this recently in the R-lang mailing
list (which I just discovered):
https://mailman.ucsd.edu/mailman/listinfo/ling-r-lang-l

I thought it might be possible to fiddle with centering to make the
correlation go away.  (I'm still not convinced that this isn't
possible in the case of a random slope and a random intercept.)

I would imagine that, if the correlations are "small" and if the
coefficients of the two forms of your model are "close", then the
results you get from the second one are a "good" approximation to what
you would get from the first if it worked.

Jon
On 01/22/11 19:57, Rachel Cohen wrote:
[...]