I make sure to never use the attach() function either.
When I import data, I merely assign it to a variable. For example:
data96 <- read.spss("ANES1996.por")
data96$V9601651 (to get a specific variable)
I never used the attach function.
I will be trying to run the probabilities with glm from the 'car' package.
Thanks
Abraham M.
-----Original Message-----
From: monkeykupo(a)gmail.com on behalf of Olivia Lau
Sent: Sun 6/20/2010 3:23 PM
To: Mathew, Abraham T
Cc: zelig(a)lists.gking.harvard.edu
Subject: Re: [zelig] Logistic Regression with Zelig
From your str ouput, it looks like you may have used
attach(data96)
at some point.
I strongly recommend NOT using attach() -- R (and Zelig) will get
confused. Try detach(data96), run your code again, and see if you
still get the error.
Yours,
Olivia
On Sun, Jun 20, 2010 at 3:55 PM, Mathew, Abraham T <amathew(a)ku.edu> wrote:
I'm running a logit model using the zelig package in R:
z.out <- zelig(trade961a ~ age962 + education962 + personal962 + economy962 +
partisan962 + employment962 + union962 + home962 + market962 + race962 + income962,
data=data96, model="logit")
The dependent variable, trade961a, is a dichotomous factor variable. All other variables
are numeric.
I am interested in personal962, which is:
str(personal962)
num [1:1714] 3 3 1 1 1 2
3 2 2 1 ...
so I run the following to simulate the probability of supporting international trade when
personal962 is 1 (better):
x.out <- setx(z.out, personal962=1)
I get the following error message:
#Error in dta[complete.cases(mf), names(dta) %in% vars, drop = FALSE] :
# incorrect number of dimensions
Any ideas on what I'm doing wrong?
Thanks
Abraham M.
-
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/
-
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/