Hi, Kirill.
To obtain a first difference, you need to compare the expected value
of Pr(Party = 1 | pr_J = 1) to some other Pr(Party = 1 | ... ). Since
I don't know what you're using for the ..., let's focus on how to
calculate Pr(Party = 1 | pr_J = 1). There are two approaches:
1) The way you have it set up now, category J is the reference
category, such that if pr_U = 0, pr_K = 0, and pr_L = 0, then you can
calculate Pr(Party = 1 | pr_J = 1). In code:
z.out <- zelig(Party ~ Presidentialism + pr_U + pr_K + pr_L,
model = "logit", data=dat).
x.out <- setx(z.out, pr_U = 0, pr_K = 0, pr_L = 0)
s.out <- sim(z.out, x = x.out)
2) When you have a categorical variable in Zelig (or in R, for that
matter), you don't need to separate the variable into indicator
variables as you have done. Let's suppose that a categorical variable
pr has values U, K, L, and J. Then you can do:
z.out <- zelig(Party ~ Presidentialism + as.factor(pr), model =
"logit", data=dat)
x.out <- setx(z.out, as.factor(pr) = "J")
s.out <- sim(z.out, x = x.out)
Best,
Olivia
On Thu, Jul 2, 2009 at 5:27 AM, Kirill Olegovich
Kalinin<kkalinin(a)umich.edu> wrote:
Dear Olivia,
I wonder how, can I compute first differences for the reference category,
using Zelig. Let?s say, I have four dummy variables pr_U, pr_K, pr_L, pr_J
obtained from a single category variable. So after dropping pr_J, I run
the model z.out <- zelig(Party ~ Presidentialism + pr_U + pr_K + pr_L,
model = "logit", data=dat). How do I calculate first difference for
dropped pr_J?
Thank you for your help!
Best,
Kirill.
-
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/