Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Re: Monte Carlo Simulation


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Re: Monte Carlo Simulation
Date   Sun, 18 Jan 2009 15:33:54 +0000 (GMT)

--- From: "STATA Dndee" <[email protected]>
> > > I want to rank institutions for and outcome given in
> > > outcome% based on Monte Carlo simulation and produce a table
> > > like table 2 in http://plus.maths.org/issue46/risk/index.html. 
> > > The method is also described by Spiegelhalter in BMJ, 1998,
> > > 316(1701-1705).

--- On Sun, 18/1/09, Martin Weiss <[email protected]> wrote:
> > Try -help simulate- for a start!

--- STATA Dndee <[email protected]> wrote:
> I tried it before but couldn't understand the commands in Help file.
> I arranged the data with the CIs.				
> 
>      +-------------------------------------------------------+
>      | inst   cases   total   outcome     lci     uci     se |
>      |-------------------------------------------------------|
>   1. |    f      71     273    26.01%   20.8%   31.2%   2.7% |
>   2. |    e     259     809    32.01%   28.8%   35.2%   1.6% |
>   3. |    c     121     345    35.07%   30.0%   40.1%   2.6% |
>   4. |    d     262     726    36.09%   32.6%   39.6%   1.8% |
>   5. |    b     192     480    40.00%   35.6%   44.4%   2.2% |
>      |
>   6. |    a     120     204    58.82%   52.1%   65.6%   3.4% |
>   7. | mean     713    2153    33.12%   31.1%   35.1%   1.0% |
>      +-------------------------------------------------------+

I have a very hard time understanding what you want to do. My best
effort on this leads me to believe that you don't want to do a
simulation (or you have already done one) but instead you want to know
how to make a certain graph (which you confusingly called table 2). If
that is the case see the example below:

*------------- begin example ---------------------
clear
input str4 inst cases total outcome lci uci se 
f      71     273    26.01   20.8   31.2   2.7 
e     259     809    32.01   28.8   35.2   1.6 
c     121     345    35.07   30.0   40.1   2.6 
d     262     726    36.09   32.6   39.6   1.8 
b     192     480    40.00   35.6   44.4   2.2 
a     120     204    58.82   52.1   65.6   3.4 
mean  713    2153    33.12   31.1   35.1   1.0
end

gen order = -outcome
egen yaxis = axis(order) ///
     if inst!="mean", label(inst) 
replace yaxis = 0 if inst == "mean"
label define yaxis 0 "mean" , modify
label value yaxis yaxis

twoway rcap lci uci yaxis, ///
       horizontal || ///
       scatter yaxis outcome, ///
       ylab(0/6,valuelabels)  ///
       ytitle("institution") ///
       legend(off)
*--------------- end example -----------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room N515

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index