lines could be added to a plot by
lines(x,y)
where x is a vector of x coordinates and y is a vector of y coordinates.
Here is an example from the manual, which can be run by example(plot.ci)
lines(age.range, apply(s.out$qi$fd, 2, mean))
lines(age.range, apply(s.out$qi$fd+s.out$qi$ev, 2, mean))
In your case, x would be chos.range rather than age.range
Kosuke
--
Department of Politics
Princeton University
http://imai.princeton.edu
On Tue, 15 Dec 2009, Yiannis E. Spanos wrote:
Dear Colleagues,
I am using Zelig to run a "logit.gee" model with an interaction, as shown in
the code below:
z.out <-
zelig(ict~keytech+all1*chos+cind_motiv+cind_prior+ctop_support+cit_slack+cfi
rm_perfo+cstr_allign+clog_is_people+cis_level+is_status+cdyn+cempl+cemplsq+q
155, model = "logit.gee",
id = "code", corstr="unstructured",data = Dataset)
chos.range <- seq(from = -3.559, to = 1.941, by = 0.05)
x.low <- setx(z.out, all1 = 0, cemplsq = 0, chos = chos.range)
x.high <- setx(z.out, all1 = 1, cemplsq = 0, chos = chos.range)
s.out <- sim(z.out, x = x.low, x1 = x.high)
I then use the plot.ci function to plot the confidence intervals around the
ev of the simulations, using the code:
plot.ci(s.out, CI=95, qi = "ev", xlab = "Technological Opportunity",
ylab = "Probability",
main = "Predicted Difference in Probability between full and no
configuration", xlim = c(-4, 2), ylim = c(0.00, 0.90), type = "l")
legend(-1, 0.15, legend = c("Full AC configuration",
"Partial or No AC configuration"), col = c("blue","red"),
lty = c("dashed", "dotted"))
Again everything works just fine, producing the graph in the attached file.
My question is: Is it possible to have in the same graph the point estimates
of the predicted probabilities (connected in a line across the values of the
X-axis variable) together with the confidence intervals, and if yes, how
could I do it? To give an impression of what I'm talking about, I have
included an example I have found in the attached file.
Many thanks in advance for your attention,
Yiannis Spanos
*************************************************
Dr Yiannis Spanos, Assistant Professor of Strategy
Athens University of Economics and Business (AUEB)
Department of Management Science and Technology
47A Evelpidon Street & 33 Lefkados Street,
113 62 Athens, Greece
Tel: + 210 8203 668, Fax: + 210 8828 078
************************
"To salvage a general principle from a mass
of conflicting evidence can be both science
and poetry."
L. Durrell, Monsieur - The Avignon Quintet
******************************************************
-
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/