That seems to be a bug. There is likely no way to perfectly mimic that feature of
'lmer' at the moment.
I opened a ticket for the issue here:
https://redmine.hmdc.harvard.edu/issues/793, if you
would like to track the bug's status. However, its fix will probably not be available
until a later release.
Thanks for making the demo script
Cheers -
Matt
e: mowen(a)iq.harvard.edu
p: 6-6132
On Jul 21, 2011, at 9:26 AM, Francois Maurice wrote:
Hi,
I found that zelig() and lmer() give different results with polynomial time in random
effects part of the formula. But the results are identical without polynomial in random
effects part.
Here's lmer() and zelig() without polynomials in the random part:
sleep.lmer <- lmer(Reaction ~ Days + Days2 + Days3 + (Days | Subject),
sleepstudy.modified.2)
sleep.zelig <- zelig(Reaction ~ Days + Days2 + Days3 + tag(Days | Subject),
sleepstudy.modified.2, model="ls.mixed")
Here's lmer() and zelig() with polynomials in the random part:
sleep.lmer.poly <- lmer(Reaction ~ Days + Days2 + Days3 + (Days + Days2 | Subject),
sleepstudy.modified.2)
sleep.zelig.poly <- zelig(Reaction ~ Days + Days2 + Days3 + tag(Days + Days2 |
Subject), sleepstudy.modified.2, model="ls.mixed")
I posted a demo script on
pastebin.com under the title "zelig() vs lmer() with
polynomial time".
The demo uses the sleep study data form lme4 package, wich I modified to add square and
cubic time.
If I want to obtain the same results as in lmer() what can I do in zelig() ?
Merci,
François Maurice, B. Sc., A. Stat.
Candidat à la maîtrise
Département de sociologie
Université de Montréal