[R-sig-ME] predict in lmer()?

David Winsemius dwinsemius at comcast.net
Sun Jul 31 15:35:45 CEST 2011


On Jul 31, 2011, at 8:47 AM, Dennis Murphy wrote:

> Hi:
>
> See http://glmm.wikidot.com/faq
>
> Go about 2/3 of the way down until you see the section 'Predictions
> and/or confidence (or prediction) intervals on predictions'.

Aren't objects created by lmer of class "mer"? Attempting to follow  
your advice with the first example provided in ?lmer meets with  
frustration:

require(lme4)
(fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
  newdat0 <- expand.grid(Reaction=c(200,300,400), Days=c(0,4,8),  
Subject=c(5,10,15) )
  newdat0$pred <- predict(fm1, newdat0, level = 0)

Error in UseMethod("predict") :
   no applicable method for 'predict' applied to an object of class  
"mer"

I'm not even a journeyman use of ME methods, so this is just a  
question. Do you have a fix? (There are predict methods listed in nlme  
but none in the Index of lme4.

-- 
David.



David Winsemius, MD
West Hartford, CT




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