david, i'm now slogging thru the most informative thread!

as dennis advised, one has to do the 'predict' part 'by hand' when using lmer.  this is done in the 2 lines:
mm = model.matrix(terms(fm1),newdat)
newdat$distance = mm %*% fixef(fm1)
good luck - this thing is worth sticking with!
ewart

On Jul 31, 2011, at 6:35 AM, David Winsemius wrote:

> 
> 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
> 


	[[alternative HTML version deleted]]


