# [R] Strange Estimates from lmer and glmmPQL

Martin Maechler maechler at stat.math.ethz.ch
Thu Dec 1 10:44:31 CET 2005

```>>>>> "Rick" == Rick Bilonick <rab45 at pitt.edu>
>>>>>     on Wed, 30 Nov 2005 23:11:07 -0500 writes:

Rick> I'm trying to fit a generalized mixed effects model to a data set where
Rick> each subject has paired categorical responses y (so I'm trying to use a
Rick> explanatory factor x. I'm trying to fit something like:

Rick> (lmer(y~x+(1|subject)))

If you want binomial you have to give ' family = binomial '  to lmer !

Further, always using  'data = ..' is generally recommended practice,
and I'd rather assign the result of lmer(.) than just print it,
i.e. (if you want to print too):

(model1 <- lmer(y ~ x + (1|subject), data = <your DFrame>, family = binomial))

and in your case  y should be the 2-column matrix
cbind(successes, failures)

Martin Maechler, ETH Zurich

Rick> I also tried fitting the same type of model using glmmPQL from MASS. In
Rick> both cases, I get a t-statistic that is huge (in the thousands) and a
Rick> tiny p-value. (Just for comparison, if I use lrm ignoring the clustering
Rick> I get a t-statistic around 3 or so and what appears to be a reasonable
Rick> estimated coefficient which is very close to the estimated coefficient
Rick> using just one observation from each subject.

Rick> Most of the subjects have two responses and in almost all cases the
Rick> responses are identical although the explantory factor values are not
Rick> always identical for each subject.

Rick> If I use geeglm from geepack, I get reasonable estimates close to the
Rick> naive model results.

Rick> I also tried using the SAS glimmix macro to fit a generalized mixed
Rick> model and the routine does not converge.

Rick> Why does geeglm appear to work but not lmer and glmmPQL? Is this likely
Rick> to be due to my particular data set?

Rick> Rick B.

Rick> ______________________________________________
Rick> R-help at stat.math.ethz.ch mailing list
Rick> https://stat.ethz.ch/mailman/listinfo/r-help