Skip to content

predict.glmmPQL Problem

1 message · Brian Ripley

#
On Thu, 30 Mar 2006, Simon Blomberg wrote:

            
This example works in current R!  The quoted R version is very old, and 
the reason I did not reply to the original posting was that the advice in 
the posting guide had been ignored.

The effect of do.call is to substitute in values, in this case including 
the whole data frame.  You can do that just for the formula by

model3 <- eval(substitute(
                glmmPQL(form, ~1 | factor(x2), family=poisson, data=mydata),
                list(form = f)))

and you might want to do that if using a model-fitting function from 
inside a function.

Note that the underlying problem is the non-standard way lme uses 
formulae: the common model-fitting functions use terms(), and
y ~ x1
attr(,"variables")
list(y, x1)
...

has captured the formula.