Good morning
If I run
<<<
susan.lsmixed.out <- zelig(formula = unprot_vag_sex ~ married + age + TREATMENT.ARM*time + highest_grade + income + tag(1|id),
data = susanMI.out$imputations, model = "ls.mixed")
summary(susan.lsmixed.out)
>>>>
I get an error
Error in x$coef : $ operator is invalid for atomic vectors
Searching the archives, I see that others have had similar problems. Is there a workaround?
summary(susan.lsmixed.out[[1]])
works fine; should I then average across the five imputed data sets?
thanks!
Peter
Peter L. Flom, PhD
Statistical Consultant
Website: http://www DOT statisticalanalysisconsulting DOT com/
Writing; http://www.associatedcontent.com/user/582880/peter_flom.html
Twitter: @peterflom
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options: http://lists.gking.harvard.edu/?info=zelig
Zelig program information: http://gking.harvard.edu/zelig/
That's great. I'm glad that you figured it out.
Kosuke
--
Department of Politics
Princeton University
http://imai.princeton.edu
On Thu, 8 Apr 2010, Cesar Zucco wrote:
> Just realized that converting the clustering variable pty to a numeric
> vector (instead of a factor) solves the problem!
>
> Sorry for the trouble!
>
> Cesar
>
> -----Original Message-----
> From: Cesar Zucco [mailto:zucco@princeton.edu]
> Sent: Wednesday, April 07, 2010 8:46 PM
> To: Kosuke Imai; sayan dasgupta
> Cc: zelig(a)lists.gking.harvard.edu; Terry Therneau; Terry Therneau
> Subject: Re: [zelig] Re: robust se's in zelig's tobit
>
> Dear Sayan,
>
> Here's a quick follow up to the cluster issue in Zelig that circulated a
> few
> days back. Sorry to keep you on this.
>
> I was able to run clustering with tobit in Zelig but I'm having some
> trouble
> with the post-estimation commands. If I ran this without clustering,
> post
> estimation works fine:
>
> tob4 <-
> zelig(mrelideal~relideo+incab+prespty+legis,model="tobit",data=data.set)
> x.out <- setx(tob4,incab=0,legis=1995,relideo=mean(data.set$relideo))
> x.in <- setx(tob4,incab=1,legis=1995,relideo=mean(data.set$relideo))
> x.out
> (Intercept) relideo incab presptyTRUE legis1990 legis1995 legis2000
> 1 1 2.086757 0 0 0 1 0
> sims <- sim(tob4, x = x.out, x1 = x.in)
>
>
> However, if I ran this with the clustering, setx does not treat the
> clustering correctly.
>
> tob4 <-
> zelig(mrelideal~relideo+incab+prespty+legis,cluster="pty",robust=T,
> model="tobit",data=data.set)
> x.out <- setx(tob4,incab=0,legis=1995,relideo=mean(data.set$relideo))
> x.in <- setx(tob4,incab=1,legis=1995,relideo=mean(data.set$relideo))
> x.out
> (Intercept) relideo incab presptyTRUE legis1990 legis1995 legis2000
> cluster(pty)PC cluster(pty)PN cluster(pty)NE
> 1 1 2.086757 0 0 0 1 0
> 0 0 0
> sim(tob4, x = x.out, x1 = x.in)
>> Error in sim.coef %*% t(x) : non-conformable arguments
>
>
> I tried getting rid of the extra values in x.out by brute force (by
> deleting
> any columns with cluster in the name but I think sim is using the wrong
> variance-cov matrix to draw the simulations.
>
> Any workarounds?
>
> Thanks,
>
>
> Cesar Zucco
>
> On 3/19/10 8:54 AM, "Kosuke Imai" <kimai(a)Princeton.Edu> wrote:
>
>> Great. Thanks, Sayan!
>>
>> Kosuke
>
>
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options: http://lists.gking.harvard.edu/?info=zelig
Zelig program information: http://gking.harvard.edu/zelig/