Hi Shane -
Regarding your code, I think you meant to type:
x.open <- setx(cbgov.model, unemployment = 0:4, incumbent=0)
Instead of:
x.open <- setx(cbgov.model,unemployment= 0-4, incumbent=0)
The former sets unemployment at the integer values 0 through 4, where as the latter sets
uemployment at -4 (zero minus four).
Additionally, there is an a current issue in "plot.ci" that prevents it from
plotting confidence intervals of quantities of interest that contain only a single
specified value. This example would break:
x.out <- setx(cbgov.model, umemployment = 0)
s.out <- sim(cbgov.model, x.out)
plot.ci(s.out)
But this would not:
x.out <- setx(cbgov.model, umemployment = 0:4)
s.out <- sim(cbgov.model, x.out)
plot.ci(s.out)
Note that the top lines of each code snippet differ. This issue is currently being patches
and should be available early next week.
Thanks for the report! Follow ups on this code can be tracker on GitHub here:
https://github.com/IQSS/Zelig/issues/28
And on google groups here:
https://bit.ly/Te567J
Matt
On Dec 12, 2012, at 3:42 PM, Shane Gleason wrote:
Hello everyone,
I am using the relogit command in Zelig and am trying to graph an
interaction term in my model.
Looking through the lists, I found someone who had a similar problem a
few years back and I followed the solution posed therein:
https://lists.gking.harvard.edu/pipermail/zelig/2009-March/000808.html
However, I keep getting an error message:
Error in x[[1]]$x : $ operator is invalid for atomic vectors
I tried to use plot.ci on the example included in the Zelig manual (in
place of plot), but I got the same error message. I'm relatively new to
R, so I imagine this is probably a pretty basic fix, but I appreciate
any and all help you can provide.
Shane
My code:::
data(cbg)
cbgov.model <- zelig(comeback ~ campaign_spending + incumbent + quality_cand + lagvote
+ corruption + unemployment + I(incumbent*quality_cand) + I(lagvote*incumbent) +
I(unemployment*incumbent) + I(corruption*incumbent), tau=0.078, model="relogit",
data=cbg)
x.open <- setx(cbgov.model,unemployment= 0-4, incumbent=0)
x.incumbent <- setx(cbgov.model,unemployment= 0-4, incumbent=1)
s.out <- sim(cbgov.model, x=x.incumbent, x1=x.open)
Warning message:
In eigen(Sigma, symmetric = TRUE, EISPACK = TRUE) :
EISPACK = TRUE is deprecated
plot.ci(s.out, xlab="this is x", ylab="this is y")
Error in x[[1]]$x : $ operator is invalid for atomic vectors
--
Shane Gleason
Doctoral Candidate
Southern Illinois University:Carbondale
Department of Political Science
Faner 3172
-
--
Zelig Mailing List, served by HUIT
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/mailman/listinfo/zelig
Zelig program information:
http://gking.harvard.edu/zelig/
Zelig mailing list
Zelig(a)lists.gking.harvard.edu
To unsubscribe from this list or get other information:
https://lists.gking.harvard.edu/mailman/listinfo/zelig