Note that x.high contains only one row = one observation, and x.low
similarly contains only one row = one observation. Therefore, the
expected values also only have one *column*.
If you want to generate two column sim output, you need to have two
rows in your setx object. You can hack this by doing:
x.combined <- rbind(x.high, x.low)
class(x.combined) <- class(x.high) # Absolutely essential. Don't skip!!!
(which I haven't tried, but should work)
Then the ev in sim output should be 1000 (simulations) x 2 (observations).
Good luck,
Olivia
On Mon, Jun 6, 2011 at 3:19 PM, Tom Wood <tomwood(a)uchicago.edu> wrote:
Hi Zelig List
I'm confused about how expected values, first differences etc are indexed
when you instruct Zelig to include more than one x value. For instance
library(Zelig)
data(voteincome)
z.out1 <- zelig(vote ~ education + age + female + tag(1 | state),
data = voteincome,
model = "logit.mixed")
x.high <- setx(z.out1, education = quantile(voteincome$education,
+ 0.8))
x.low <- setx(z.out1, education = quantile(voteincome$education,
+ 0.2))
s.out1 <- sim(z.out1, x = x.high)
dim(s.out1$qi$ev)
[1] 1000 1
s.out2 <- sim(z.out1, x = x.high, x1 = x.low)
dim(s.out2$qi$ev)
[1] 1000 1
The zelig manual suggests that these quantities will be indexed by
simulation × quantity × x-observation. That doesn't seem to be happening
here. Can I access the separate probabilities for both X and X1, or do I
need to simulate them with separate sim calls?
Tom
-
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/