Dear James (and Matt),
thanks a lot for this. Actually, I was using it for teaching last week, and it was a good
example to link up getting quantities of interest out in a different ways, look a bit more
careful at functions, and more importantly to emphasize that package developers and
maintainers are very responsive (the joys of intro to R courses).
So thanks for the fix and the example!
Best, Zoltan
On Feb 22, 2013, at 8:58 PM, "Honaker, James" <jhonaker(a)iq.harvard.edu>
wrote:
Zoltan,
I should have mentioned this earlier, but the Zelig package up on the CRAN mirrors is now
corrected too.
Thanks again for pointing this out,
James.
--
James Honaker, Senior Research Scientist
//// Institute for Quantitative Social Science, Harvard University
________________________________________
From: Honaker, James
Sent: Saturday, February 16, 2013 11:43 PM
To: Zoltan; zelig(a)lists.gking.harvard.edu
Subject: RE: [zelig] possible anomaly in plot for expected values (logit, probit)
Zoltan,
Thanks for finding this issue. It is now fixed in the source code available on Github.
We will post a new package at the local Zelig repository shortly, and to CRAN. When these
are posted I'll send out another message.
In the meantime, if you want to immediately press forward, you can try either to [1]
compile from the source on github, or [2] overwrite the changed functions in the Zelig
namespace. I've put directions for this, if useful, below.
Thanks again,
James.
-------------------------------------------------------------
[1] To compile from source, try the following. Currently whether this works depends on
how latex is set up on your machine. Type the following in the R console:
install.packages("devtools")
library(devtools)
install_github(repo="Zelig", user="IQSS", ref = "master")
[2] To overwrite the functions, in your code, somewhere after library("Zelig")
or require("Zelig"), the following two functions into your code (or put the two
functions into another file, and source that file into your code):
plot.simulations from the bottom of:
https://github.com/IQSS/Zelig/blob/master/R/plots.R
simulations.plot form :
https://github.com/IQSS/Zelig/blob/master/R/simulations.plot.R
then put the following lines into your code to replace the functions in the Zelig package
namespace:
assignInNamespace("simulations.plot", simulations.plot, ns="Zelig")
assignInNamespace("plot.simulations", plot.simulations, ns="Zelig")
Let me know you have any other questions, and thanks again, James.
--
James Honaker, Senior Research Scientist
//// Institute for Quantitative Social Science, Harvard University
________________________________________
From: zelig-bounces(a)lists.gking.harvard.edu [zelig-bounces(a)lists.gking.harvard.edu] On
Behalf Of Zoltan [zoltan.fazekas(a)gmail.com]
Sent: Saturday, February 16, 2013 8:47 AM
To: zelig(a)lists.gking.harvard.edu
Subject: [zelig] possible anomaly in plot for expected values (logit, probit)
Hi there,
I might doing something incorrect here, so please bear with me, but it seems to me that
there is a problem when doing a summary plot after the simulation for logit model. To me,
the plots for expected (Y|X1) seems incorrect, though when I pull the number out of qi,
everything looks alright.
My session info:
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Zelig_4.1-2 sandwich_2.2-9 zoo_1.7-9 MASS_7.3-22 boot_1.3-7
loaded via a namespace (and not attached):
[1] grid_2.15.2 lattice_0.20-10
Reproducible example:
require(Zelig)
REP <-
read.csv("http://zfazekas.github.com/docs/rep.csv".csv", sep =
",")
REP <- na.omit(REP)
pid.zelig <- zelig(close_dummy ~ educ + polinfo + age,
data = REP, model = "logit",
cite = F)
summary(pid.zelig)
x.low <- setx(pid.zelig, polinfo = 0)
x.high <- setx(pid.zelig, polinfo = 1)
s.pid.zelig <- sim(pid.zelig, x = x.low, x1 = x.high) ## Again, we are focusing on
first differences
summary(s.pid.zelig)
plot(s.pid.zelig)
par(mfrow = c(1,1))
hist(as.numeric(s.pid.zelig$qi[[2]]))
----------------------
Zoltan Fazekas