[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

R: st: Monte Carlo resampling

From   "Carlo Lazzaro" <[email protected]>
To   <[email protected]>
Subject   R: st: Monte Carlo resampling
Date   Sat, 19 Jan 2008 18:30:30 +0100

Dear Maarten,
thanks a lot for your (as usual) kind and prompt answer.

My question came up after a comparison between the results of 
gen Invgamma=556*invgammap(1, uniform()) in 1/10000


gen A=556

. sum A

    Variable |       Obs        Mean    Std. Dev.       Min        Max
           A |     10000         556           0        556        556

. return list

                 r(N) =  10000
             r(sum_w) =  10000
              r(mean) =  556
               r(Var) =  0
                r(sd) =  0
               r(min) =  556
               r(max) =  556
               r(sum) =  5560000

. scalar a=(r(mean)/r(mean))^2 //assuming that the mean is the same value as
the std. dev.

. scalar b=(r(mean)^2/r(mean)) //assuming that the mean is the same value as
the std. dev.

. simulate (b*invgammap(a, uniform())), reps(10000) nodots seed(999): sum A

      command:  summarize A
       _sim_1:  b*invgammap(a, uniform()).

Even though similar both in terms of mean and standard errors, these two
approaches give back different ranges.

Thanks a lot again, with the sincere hope that replying to my thread has not
reduced too much your time for fine-tuning your dissertation!

Kind Regards,


-----Messaggio originale-----
Da: [email protected]
[mailto:[email protected]] Per conto di Maarten buis
Inviato: sabato 19 gennaio 2008 16.25
A: [email protected]
Oggetto: Re: st: Monte Carlo resampling

--- Carlo Lazzaro <[email protected]> wrote:
> does -simulate- suite resample with reintroduction?

No, -simulate- just repeatedly calls a program and stores the results.
So, the way you sample (or whether you sample at all) depends on the
program that -simulate- calls. If your program drew a sample with
reintroduction than -simulate- would do what you just asked. However,
the easier way to do that is to call -bootstrap-.

The strong point of -simulate- is that is makes it easier to play
around with different techniques and find out their strong and weak
points. Its primary usefullness is in that sense theoretical, while the
primary usefulness of -bootstrap- is empirical (it helps you to
describe your data). Though the distinction is not black and white. 

Some examples of the use of -simulate- are: 
(bottom of the post)
though note:

Hope this helps,

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

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Sent from Yahoo! Mail - a smarter inbox

*   For searches and help try:

*   For searches and help try:

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