s.out1 <- sim(x.out1, x = x.out1)
should be:
s.out1 <- sim(model3.z, x = x.out1)
Kosuke
Department of Politics
Princeton University
http://imai.princeton.edu
On Aug 7, 2011, at 7:27 AM, Mattia Guidi wrote:
> Hi everyone,
>
> I am trying to simulate expected probabilities for a logistic model, but I get a
strange error message when running sim().
> Since I am using a data frame from the 'car' package by J. Fox, the code
can be easily reproduced by everyone.
>
> Here is the code I am running:
>
> library(car)
> library(Zelig)
> data(Chile)
> Chile$vote.d <- recode(Chile$vote, "'N'=0; 'Y'=1;
else=NA")
> model3.z <- zelig(vote.d ~ region + sex + population + age + education + income +
statusquo,
> model="logit", data=Chile)
> summary(model3.z)
> x.out1 <- setx(model3.z, sex="M", education="PS")
> summary(x.out1)
s.out1 <- sim(x.out1, x = x.out1)
>
> The last command returns the following error message:
>
> Error in UseMethod("vcov") :
> no applicable method for 'vcov' applied to an object of class
"data.frame"
>
> I have tried to google this message, but I found only a few results, and none of them
was useful for understanding where the problem is. Note that, until the last command, I do
not get errors or warnings from any of the previous functions. demo(logit) does not return
any errors.
>
> Thanks in advance for your help.
>
> Mattia
>
> --------------------------
> (Mr.) Mattia Guidi
> Ph.D Candidate
>
> European University Institute
> Department of Political and Social Sciences
> Badia Fiesolana
> Via dei Roccettini 9
> I-50014 San Domenico di Fiesole (FI)
> ITALY
-
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/