[R] How to get predictions, plots, etc. from lmer{lme4}

Douglas Bates bates at stat.wisc.edu
Sat Apr 16 15:16:34 CEST 2005


Michael Kubovy wrote:
> Kindly send a cc to me when replying to the list.
> 
> I'm having trouble using lmer beyond a first step.
> 
> My data:
>  > some(exp1B)
>     sub   ba amplitude   a   b  c  d
> 2     1 1.00       1.5  65  63  4  8
> 41    4 1.15       0.0  92  41  3  4
> 43    4 1.15       3.0  88  48  2  2
> 63    6 1.00       3.0  50  72  9  9
> 77    8 1.15       0.0 112  25  2  1
> 89   10 1.15       0.0  37  33 36 34
> 126  13 1.15       1.5  80  50  6  4
> 140  14 1.15       4.5  12 115  6  7
> 145  20 1.00       0.0  73  65  0  2
> 147  20 1.00       3.0  63  72  2  3
> etc.
> 
> The output:
>  > summary(exp1B.both.cont.lmer)
> Linear mixed-effects model fit by maximum likelihood
> Formula: cbind(b, a) ~ ba + amplitude + (1 | sub)
>    Data: exp1B
>       AIC      BIC    logLik MLdeviance REMLdeviance
>  768.0086 783.2579 -379.0043   758.0086     766.3104
> Random effects:
>  Groups   Name        Variance Std.Dev.
>  sub      (Intercept) 0.18787  0.43344
>  Residual             6.36355  2.52261
> # of obs: 156, groups: sub, 13
> 
> Fixed effects:
>               Estimate Std. Error  DF  t value  Pr(>|t|)
> (Intercept)   4.118806   0.397780 153  10.3545 < 2.2e-16
> ba           -4.205518   0.330010 153 -12.7436 < 2.2e-16
> amplitude     0.137958   0.023754 153   5.8076 3.547e-08
> 
> This is just what I need. But I also need predicted values, plots, etc, 
> and can't figure out how to proceed. Have I overlooked a more extended 
> document than the rather terse (for me at least) help page?

I regret to say no.  Methods for generalized linear mixed models fit by 
lmer are still rather rudimentary.




More information about the R-help mailing list