[R-sig-ME] confidence intervals in lmer
Jonathan Baron
baron at psych.upenn.edu
Sat Jan 22 21:50:09 CET 2011
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:
> 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|sp
> ecies_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+cen
> tre.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?
[...]
--
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron
Editor: Judgment and Decision Making (http://journal.sjdm.org)
More information about the R-sig-mixed-models
mailing list