Keith,
no clue what this is about. It's hard from the information given. Check is
your subsetted data looks ok and whether it has all the variables in it.
Otherwise you may want to contact the Zelig help list as outlined in the
question section here.
-----Original Message-----
From: gov2001-l-bounces at
lists.fas.harvard.edu [mailto:gov2001-l-
bounces at
lists.fas.harvard.edu] On Behalf Of Keith Schnakenberg
Sent: Tuesday, March 25, 2008 10:57 AM
To: gov2001-l at
lists.fas.harvard.edu
Subject: Re: [gov2001-l] by argument in Zelig
That seems to work well. I have still been unable to figure out this
error when I call zelig: ""Error in eval(predvars, data, env) :
invalid 'envir' argument." What exactly is the environment anyway? My
call to zelig is as follows:
library(Zelig)
m1sample=ssrl[HFOR==1,]
m1 <- zelig(ENGLISH ~ TIME + PCTH2 + CONTACT + SEND + VISIT2 + LIVED
+ MEXICAN + MALE + EDU + INCOME + AGE, model="logit",
data="m1sample")
On Mar 25, 2008, at 5:42 AM, Jens Hainmueller wrote:
Keith,
Take a look at the zelig help file. "variable" has to be a factor
(see
?as.factor(variable)) and also this will run the
a separate model
for each
level of variable so if for one level there are only very few obs
the model
may not be identified.
In your case when you only want to run the model for variable=1,
you should
rather subset the data like:
data=mydata[variable==1,]
Hth,
Jens
-----Original Message-----
From: gov2001-l-bounces at
lists.fas.harvard.edu [mailto:gov2001-l-
bounces at
lists.fas.harvard.edu] On Behalf Of Keith Schnakenberg
Sent: Monday, March 24, 2008 10:34 PM
To: gov2001-l at
lists.fas.harvard.edu
Subject: [gov2001-l] by argument in Zelig
Let's say I have a variable called "variable," which is a dummy
variable, and I want to do a logistic regression only for cases in
which variable=1. I give Zelig the following command:
m1 <- zelig(Y ~ x1 + x2 + x3, model="logit", data="mydata",
by="variable")
And Zelig tells me:
"Error in dat[, by] : incorrect number of dimensions"
Can anybody shed some light on what I'm doing wrong?
Thanks,
Keith
_______________________________________________
gov2001-l mailing list
gov2001-l at
lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
_______________________________________________
gov2001-l mailing list
gov2001-l at
lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
_______________________________________________
gov2001-l mailing list
gov2001-l at
lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l