Hello Olivia,
Thank you for your help! Let?s say I need to find Pr(Party = 1 | pr_J = 0)
- Pr(Party = 1 | pr_J = 1). Is it ok, to write in Zelig
Partisanship.low<- setx(z.out, pr_U=0, pr_K=0, pr_L=0)
Partisanship.high<- setx(z.out, pr_U=1, pr_K=0, pr_L=0) # or pr_K=1 or
pr_L=1 to get pr_J=0
s.out<-sim(z.out, x=Partisanship.high, x1=Partisanship.low)
summary(s.out)
Is this the right logic?
Best,
Kirill.
Quoting Olivia Lau <olivia.lau(a)post.harvard.edu>du>:
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.