Dear Gary,
Risk ratio will be E(Y|X)/E(Y|X') where X and X' represent data vector
from two different data sets. What I want is, in the same data set,
E(Y|X)/(1-E(Y|X)), and Zelig does not output that value.
Now I am trying to calculate that quantity of interest using the
simulation results, as you suggested. It should be a straightforward
operation like this:
s.out1$sbr <- s.out1$qi$ev/(1-s.out1$qi$ev)
where "s.out1" is the simulation outcome. The problem is this: instead of
fixing everything at their mean or median level and carry out one
simulation, I am doing a in-sample prediction where N = 10,000. With
m=1,000, the resulted s.out1$sbr (so as s.out1$qi$ev and other s.out1parameters) is a
matrix of 10,000*1,000.
What I want to get is a typical zelig output: an expected value of the new
quantity (s.out1$sbr), standard deviation, and confidence interval. My
question is: how to get these quantities from this 10,000*1,000 matrix?
Thanks.
Best,
Shige
On Feb 5, 2008 2:43 AM, Gary King <king(a)harvard.edu> wrote:
this is the 'relative risk' or 'risk ratio'. Lots of Zelig
procedures
will report this automatically. If any don't that you want to use, you
can take the simulations out of z.out, compute the risk ratio for each,
and then compute the mean of the simulations and (say) their standard
deviation for a point estimate and standard error.
Gary
On Mon, 4 Feb 2008, wrote:
Dear Gary and Colleagues,
In my case, the quantity of interest is sex ratio of birth (number of
boys
divided by number of girls born in a year). This can be calculated as
(E(Y)/(1-E(Y))), where E(Y) is the expected probability of having boy.
Is
there a way to make Zelig directly output this quantity? Thanks.
Shige
On Jan 28, 2008 1:47 AM, Gary King <king(a)harvard.edu> wrote:
Often, estimates based on matched data is what you want. Without
matching, analyses can be highly 'model dependent', which means that
your
results can very sensitive to minor specification
decisions (which can
make the results you choose to present highly suspect). If the goal
is
causal inference, preprocessing your data via
matching can eliminate
much
of this model dependence. Have a look at one of
the first two papers
at
this web site on model dependence and the third
on matching:
http://gking.harvard.edu/projects/cause.shtml
Gary
On Sun, 27 Jan 2008, wrote:
Dear Gary,
I have estimated the model using raw data and the preprocessed data
(using MatchIt), and the results are significantly different (did not
change the substantive conclusion though). My question is: for the
purpose of counterfactual simulation, which set of estimates, the ones
based on raw data or the one based on matched data, are preferable,
and why? It will be most helpful if you can point me to some
references, if they exist. Thank you very much.
Best,
Shige
On Jan 27, 2008 12:37 AM, Gary King <king(a)harvard.edu> wrote:
> Yes, that's the idea. Gary
> ---
> Sent from my phone; please excuse the terse note.
> Gary King
>
http://gking.harvard.edu
>
>
>
> -----Original Message-----
> From: "ÿÿÿÿÿÿ" <shigesong(a)gmail.com>
>
> Date: Sat, 26 Jan 2008 22:47:37
> To:"Gary King" <king(a)harvard.edu>
> Cc:zelig@lists.gking.harvard.edu
> Subject: Re: [zelig] Basic question on counterfactual simulation
>
>
Dear Gary,
>
> Let me make sure I get this right. The correct procedure to do the
> counterfactual prediction consists the following steps:
>
> 1) estimation: z.out <- zelig(Y ~ X + T, data = data,
model="logit");
2)
manipulating the data set, generate a new data set ("new.data")
with the counterfactual conditions correctly setup;
3) setx using the newly generated data: x.out <- setx(z.out, data=
new.data);
> 4) simulate posterior distribution: s.out <- sim(z.out, x=x.out).
>
> Correct?
>
> I just realize that SETX has an option to use a different data set,
> which is very convenient.
>
> Thanks.
>
> Shige
>
> On Jan 26, 2008 9:32 PM, Gary King <king(a)harvard.edu> wrote:
> >
> > yes, although of course the 'some operation' would be part of the
setx
> > step.
> > Gary
> >
> >
> > On Sat, 26 Jan 2008, å(R)~Kæ~W¶æ~L wrote:
> >
> > > Dear Gary:
> > >
> > > So it will be something like:
> > >
> > > z.out <- zelig(Y ~ X + T, data = data, model="logit")
> > >>> some operation on the data frame to get the counterfactuals
set <<
> >
x.out <- setx(z.out)
> > s.out <- sim(z.out, x=x.out)
> >
> > Correct?
> >
> > Thanks.
> >
> > Best,
> > Shige
> >
> > On Jan 26, 2008 8:59 PM, Gary King <king(a)harvard.edu> wrote:
> >>
> >> this is an interesting substantive question, but it is not
answerable by
> >> any means precisely how you have
proposed it. you also need to
specify
> > >> WHICH 25% of women had abortions. you'd get different answers
if
you
> > >> chose different groups of 25%. So just choose the ones you
want to
flip
> > >> from 0s to 1s or to set at 0s and 1s, compute your predicted
values
and
> > >> you're set.
> > >> Gary
> > >>
> > >>
> > >> On Sat, 26 Jan 2008, å(R)~Kæ~W¶æ~L wrote:
> > >>
> > >>> Dear Colleagues:
> > >>>
> > >>> I am using Zelig to estimate a population model and would like
to
do
> > >>> some counterfactual simulation based on the results. Both the
> > >>> dependent (whether have a newly born boy) and the main
independent
>
>>> variable of interest (whether had a prior abortion) are binary
ones.
> >>> Zelig can handle questions
like: what is the difference in
probability
> > >>> of having a boy between those who had prior abortion and those
who
had
> >>> not. I want to go a step
further and ask: give the estimated
model, if
> > >>> 50% of the total women had abortion, what the percentage of
boys
will
> > >>> be in all the newly born babies? What if only 25% of the women
had
> > >>> abortion? And what about
75% of women had abortion? etc. Is
there
an
> > >>> easy way to do this? Thanks.
> > >>>
> > >>> 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/
> > >>>
> > >
> > > -
> > > 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/
> >