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/
Hello,
I am trying to run a multilevel probit model using Zelig, but keep receiving
the following error message: " in .deparseTag(TT.vars[[vind]]) : wrong use
of tag function!!"
A simplified version of the model I am trying to run is:
z.out <- zelig(formula= list(mu=investment.binary ~ edlevel +
tag(1 + edlevel, gamma | country),
gamma = ~ tag(GDPpc06.full| country)), data=data2006.mod1,
model="probit.mixed")
What I would like to do is allow the intercept and the edlevel variable
listed within the first tag() to vary by country as a function of the
GDPpc06.full variable, all of which are included in the same dataframe. I
followed the syntax here - http://cran.r-project.org/web/packages/Zelig
/vignettes/probit.mixed.pdf - but I think that I am incorrectly specifying
the gamma part of the syntax, which may be causing the error.
I *am* able to get the model to run when I allow the intercept and edlevel
variable to vary using the following syntax:
z.out <- zelig(investment.binary ~ edlevel +
+ tag(1 + edlevel | country),
data=data2006.mod1, model="probit.mixed")
However, this syntax does not allow me to specify that the intercept and
edlevel variable should vary as a function of GDPpc06.full, as in the first
model specified above. I have tried including multiple tags at the
non-group level of the model specification - i.e. one for the intercept and
one for the edlevel variable - but this does not seem to work either.
Do you have any suggestions for how to fix the syntax?
Sincerely,
Jason
--
Jason I. McMann
PhD Student | Department of Politics
Princeton University | jmcmann(a)princeton.edu
Dear Zelig authors,
Thank you very much for your package it has been very helpful. I was
wondering whether
you could help me on this one. I have been using "Amelia" to carry out
multiple
imputation and then analysed the result of that using Zelig. My
outcome is binary hence I
am using logistic regression. I was wondering whether I could use
"logit.mixed" in this
context as it hasn't been working when I tried.
Secondly, I was wondering if any stepwise variable selection can be
carried out?
Lastly, how would one go about getting an AIC from the model produced
by zelig and how
would one do more diagnostics on the model?
Thank you very much for your time. I am looking forward to hearing
from you soon.
Yours sincerely,
Stella Mazeri
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
-
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/
I think it's coming from King et al. AJPS "Clarify" article. So you
should probably look at that paper.
Best,
Kosuke
--
Department of Politics
Princeton University
http://imai.princeton.edu
On Thu, 23 Jun 2011, Javier Enrique Acosta Nunez wrote:
> Good morning,
>
> I write to you about turnout database, I like more information about it,
> please
>
> 15837 observations are sample or census?
> What is the coverage of the 15837 observations?
> What database on website National Election Survey you download?
>
> Thanks for your answer and time,
>
>
-
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/
Jun,
Zelig does not support marginal effects as default quantities of interest because they are often difficult to interpret. However, you can always obtain simulated model parameters from s.out object as s.out$par and you can construct whatever other quantities of interest you like.
Kosuke
Department of Politics
Princeton University
http://imai.princeton.edu
On Jun 14, 2011, at 10:25 PM, Xu, Jun wrote:
> Dear Dr. Imai ,
>
> Sorry to directly send emails to you about Zelig that you, Gary King and Olivia Lau coauthored. I have to indicate that Zelig is a real nice package for many post-estimation analyses, and probably the best that I ever used. I have been digging around to find answers to some questions that I have, but was not able to. Basically, I am trying to get some post-estimation statistics other than some straightforward ones using Zelig. For example, to get difference in predicted probabilities in probit models using the popular Mroz,
>
> # discrete changes
> z.out <- zelig( lfp~ k5 + k618 + age + wc + hc + lwg + inc, model="probit", data=binlfp2)
> x.hi <- setx(z.out, age=quantile(binlfp2$age, prob = 0.75))
> x.lo <- setx(z.out, age=quantile(binlfp2$age, prob = 0.25))
> s.out <- sim(z.out, x = x.hi, x1 = x.lo)
> summary(s.out)
>
> But how can I get marginal effects for a given x vector? I would very much appreciate it if you could point me to the right direction/resources. Thanks!
>
> Jun Xu, Ph.D.
> Department of Sociology
> Ball State University
> Muncie, IN 47306
> Email: jxu(a)bsu.edu
>
-
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/
Hi Zelig List
I'm confused about how expected values, first differences etc are indexed
when you instruct Zelig to include more than one x value. For instance
library(Zelig)
data(voteincome)
z.out1 <- zelig(vote ~ education + age + female + tag(1 | state),
data = voteincome,
model = "logit.mixed")
x.high <- setx(z.out1, education = quantile(voteincome$education,
+ 0.8))
x.low <- setx(z.out1, education = quantile(voteincome$education,
+ 0.2))
s.out1 <- sim(z.out1, x = x.high)
dim(s.out1$qi$ev)
[1] 1000 1
s.out2 <- sim(z.out1, x = x.high, x1 = x.low)
dim(s.out2$qi$ev)
[1] 1000 1
The zelig manual suggests that these quantities will be indexed by
simulation × quantity × x-observation. That doesn't seem to be happening
here. Can I access the separate probabilities for both X and X1, or do I
need to simulate them with separate sim calls?
Tom
Dear all,
I am running an ordered probit model (DV can be 0,1,2). The model works
out relatively fine. I want to plot the results using ternary plots. I
follow the description from the manual, but there is a slight problem
with the plot. I want to fix one of the IVs to the minimum, while
changing the other IV from minimum to maximum. In the model, there is
also an interaction term between these two variables.
Here is the code for this part:
x.low <- setx(fit.environ, eimp = mineimp, open = minop)
x.high <- setx(fit.environ, eimp = maxeimp, open = minop)
s.out <- sim(fit.environ, x = x.low, x1 = x.high)
ev.high<- s.out$qi$ev + s.out$qi$fd
require(vcd)
ternaryplot(x = s.out$qi$ev, pch = ".", col = "blue", main="Extremity on
environmental issue")
ternarypoints(ev.high, pch = ".", col = "red")
The problem: when plotting the values for the situation where importance
(eimp) is at maximum (ev.high), some of the values end up outside the
triangle. I rechecked the ev.high matrix, and all the probabilities add
up to 1 (for each observation), and so it happens for the probabilities
when importance is at minimum. However, if I understand it correctly,
every point should be in the triangle (and because all add up to 1, they
actually should be there). Plot attached.
I was just wondering if anybody else had these sorts of problems. Before
running the model, I used multiple imputation (amelia, 100 imputations),
but I am not sure this should be the problem.
Thank you,
Zoltan Fazekas