Sorry, I made two mistakes in my code. I just modified it on
pastebin.com.
With those corrections, the weights argument works well with lmer() for both dataframe and
works well for the sleep data wiht zelig(). Within zelig(), the weights argument
doesn't work with my data.
Merci,
François Maurice, B. Sc., A. Stat.
Candidat à la maîtrise
Département de sociologie
Université de Montréal
--- En date de : Mer, 20.7.11, Francois Maurice <maurice.francois(a)ymail.com> a
écrit :
De : Francois Maurice <maurice.francois(a)ymail.com>
Objet : Re: [zelig] Zelig seems not to pass the 'weights' argument to lmer()
when using the ls.mixed model
À : "Matt" <mowen(a)iq.harvard.edu>
Cc : "zelig(a)lists.gking.harvard.edu" <zelig(a)lists.gking.harvard.edu>
Date: mercredi 20 juillet 2011 19 h 21
O.K., I wrote a demo script posted on
pastebin.com under "Testing ls.mixed".
I mimicked the sleep study from lme4 package. There is also a modified version of the
sleep study data in wich I created a fake weight variable to test that data. In my
knowledge, the only difference between the two dataframes is that my outcome variable has
missing data.
What is weird is that the weights argument doesn't work neither in lmer() nor in
zelig() and that for both dataframe.
Merci beaucoup,
François Maurice, B. Sc., A. Stat.
Candidat à la maîtrise
Département de sociologie
Université de Montréal
--- En date de : Mer, 20.7.11, Matt <mowen(a)iq.harvard.edu> a écrit :
De : Matt <mowen(a)iq.harvard.edu>
Objet : Re: [zelig] Zelig seems not to pass the 'weights' argument to lmer()
when using the ls.mixed model
À : "Francois Maurice" <maurice.francois(a)ymail.com>
Cc : "zelig(a)lists.gking.harvard.edu" <zelig(a)lists.gking.harvard.edu>
Date: mercredi 20 juillet 2011 15 h 55
The error seems to indicate that the weights parameter is indeed being passed, but there
is a mismatch in the length of the data.frame's rows and the weights' rows.
I think we will be able to diagnose the problem with a demo script that does two things:
1. Show the code working with the 'lmer' function
2. Show the equivalent code failing with the 'zelig' function
This should reveal to us the issue.
Cheers -
Matt
e: mowen(a)iq.harvard.edu
p: 6-6132
On Jul 20, 2011, at 3:30 PM, Francois Maurice wrote:
Hi,
I forgot to give the erreur message from R :
Error in model.frame.default(data = list(ID = c(1002L, 1003L, 1005L, 1006L, :
variables lenght differ (found for '(weights)')
I check my variables in the dataframe and they all have the same lenght. But my outcome
variable have missing values. In PROC MIXED in SAS I cas use my dataset anyway, but maybe
it is not possible in R ou Zelig ?
I tried to handle missing values with an na.action=na.pass argument to pass from zelig()
to lmer(), but it doesn't seem to work. The same error message comes back.
Merci,
François Maurice, B. Sc., A. Stat.
Candidat à la maîtrise
Département de sociologie
Université de Montréal
--- En date de : Mer, 20.7.11, Matt <mowen(a)iq.harvard.edu> a écrit :
De : Matt <mowen(a)iq.harvard.edu>
Objet : Re: [zelig] Zelig seems not to pass the 'weights' argument to lmer()
when using the ls.mixed model
À : "Francois Maurice" <maurice.francois(a)ymail.com>
Cc : "zelig(a)lists.gking.harvard.edu" <zelig(a)lists.gking.harvard.edu>
Date: mercredi 20 juillet 2011 13 h 00
After briefly browsing the 'ls.mixed' model's implementation, I found
nothing that immediately stuck out. Which version of Zelig are you using?
Also, if you could attach a demo script on
http://pastebin.com/, that might be helpful for
figuring out this problem.
Matt
e: mowen(a)iq.harvard.edu
p: 6-6132
On Jul 20, 2011, at 12:38 PM, Francois Maurice wrote:
Hi,
Zelig seems not to pass the 'weights' argument to lmer() when using the ls.mixed
model
The weights argument works properly when I use lmer() directly.
Is this a known bug ? Is there a fixe or a workaround ?
Merci,
François Maurice, B. Sc., A. Stat.
Candidat à la maîtrise
Département de sociologie
Université de Montréal