Hi everyone,
We've made some good progress on Zelig and suggest that you update to the
latest version if you haven't in a while. There are a variety of new
models in Zelig, for a grand total of 48. You'll find models for time
series (ARIMA), time series-cross sectional and clustered-data models (see
the various GEE models), some structural equation modeling (2SLS, SUR,
etc.), social network models (see the various net* models), among others.
You'll also find a much better documentation system. We've dropped the
lousy web pages created by latex2html, and now have a single documentation
page you'll find on our web site where you can quickly load just the piece
of the big PDF document that you're interested in (click on read on-line
at http://gking.harvard.edu/zelig). You can also access the identical
PDFs through our help system (e.g., help.zelig("logit") will load the
right PDF).
Since Zelig has been developed by many contributors, we've developed a new
citation standard for Zelig models that give credit to those who do the
work. The idea is an analogy to the way we generally cite chapters in
edited volumes. So Patrick Lam just added a generalized estimating
equation version of logit analysis to Zelig, which we suggest citing in
this way:
Patrick Lam. 2007. "logit.gee: Generalized Estimating Equation for
Logistic Regression," in Kosuke Imai, Gary King, and Olivia Lau, "Zelig:
Everyone's Statistical Software," http://gking.harvard.edu/zelig.
You'll find the citation information in the "How to Cite" section of each
of the models. You'll also find other reference information following
that as well.
The new version of Zelig also includes some improvements to the back-end
infrastructure, in addition to documentation. We now have very extensive
scripts to check that the code is right and that all the models work prior
to a new version appearing (which was not easy given how many other
packages Zelig depends upon), and some features to make it easier to add
new models. If any of you would like to add methods or models to zelig,
we'd love to have your participation.
As usual, if you have any questions, please send them to our listserv so
we can all see and try to help.
Best,
Gary
---
Gary King
David Florence Professor of Government,
Director, Institute for Quantitative Social Science
Harvard University, 1737 Cambridge St, Cambridge, MA 02138
http://GKing.Harvard.Edu, King(a)Harvard.Edu
Direct 617-495-2027, Assistant 495-9271, eFax 812-8581
-
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 all,
I'm having some problems getting setx() to work on a regression model
that has a factor as an independent variable and uses 5 multiply imputed
datasets. As you can see from the length of this email (apologies), I've
tried a number of solutions this morning but can't seem to fix the problem.
The basic model is:
> z.out <- zelig(pba.correct~age+as.factor(r.race),
model="poisson",
data=mi(mi1, mi2, mi3, mi4, mi5))
where "pba.correct" is a count of the number of questions a survey
respondent correctly answered, "age" is a continuous variable, and
"r.race" is a factor that describes the survey respondent's race. mi1
through mi5 are multiply imputed datasets with no missing data.
This code runs without problem, and summary(z.out) produces everything
I've come to know and love from zelig. The problem comes with:
> x.out <- setx(z.out)
Error in `contrasts<-`(`*tmp*`, value = "contr.treatment") :
contrasts can be applied only to factors with 2 or more levels
This error message seems to be the same as the one Vinh describes here:
http://lists.hmdc.harvard.edu/lists/zelig/2006_09/msg00004.html
But the solution that worked there -- to make sure that the categorical
variable is correctly specified as a factor -- doesn't seem to work for
me. "r.race" is defined as a factor, with 8 levels, and no missing data,
outside of the zelig() command.
In fact, the problem seems to be very specific to using a categorical
variable and the multiply imputed datasets. I ran the same model on just
one of the datasets, as below:
z.out <- zelig(pba.correct~age+r.race,
model="poisson",
data=mi1)
and setx() works perfectly normally. Likewise, I tried omitting the
factor and using all of the multiply imputed datasets:
z.out <- zelig(pba.correct~age,
model="poisson",
data=mi(mi1, mi2, mi3, mi4, mi5))
and that again works fine. The problem is also not one of model choice
(trying "negbin", "ologit" or even "ls" still led me to the error
message). I've tried everything I can think of and am stuck! If anyone
can think of a possible solution, I'd really appreciate your help.
Thanks, Phil
--
Ph.D. Candidate
Harvard University Department of Government
1737 Cambridge Street, Cambridge, MA 02138
-
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/