Dear All,
Zelig makes it very easy to simulate first difference (along with
predicted values, expected values, and risk ratios), is there a
convenient way to simulate second difference? For example, in the
following simple example:
------------------------------------
data(turnout)
z.out <- zelig(vote ~ race*age + educate + income,
model = "logit", data = turnout)
summary(z.out)
x.low <- setx(z.out, educate = 12)
x.high <- setx(z.out, educate = 16)
s.out <- sim(z.out, x = x.low, x1 = x.high)
------------------------------------
Now "s.out" includes the first difference between the two expected
probabilities between people with 12 years of schooling and people
with 16 years of schooling. Now I want to get the second difference
between people with 12 years of schooling and aged 20, people with 12
years of schooling and aged 30, people with 16 years of schooling and
aged 20, and people with 16 years of schooling and aged 30, will the
following code be suffice?
------------------------------------
x.low.low <- setx(z.out, educate = 12, age = 20)
x.low.high <- setx(z.out, educate = 12, age = 30)
x.high.low <- setx(z.out, educate = 16, age = 20)
x.high.high <- setx(z.out, educate = 16, age = 30)
s1 <- sim(z.out, x = x.low.low, x1 = x.low.high)
s2 <- sim(z.out, x = x.high.low, x1 = x.high.high)
did <- s1$qi$fd - s2$qi$fd
------------------------------------
Then I can conduct statistical test on the newly created "did" as
usual, for example "t.test(did)", correct? Are there other ways to do
this?
Many thanks for your input.
Best,
Shige
-
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/