Date: Wed, 8 Aug 2007 11:06:33 -0700
Reply-To: sounpra@YAHOO.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Song <sounpra@YAHOO.COM>
Organization: http://groups.google.com
Subject: Re: bootstrap simulation
In-Reply-To: <7367b4e20708071409l5927ebedm56698ff127627e52@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
On Aug 7, 4:09 pm, datan...@GMAIL.COM ("data _null_;") wrote:
> You want to use SURVERSELECT for this and also read Cassells. If you
> really think you need the original data stuck to the front of the
> boot strap sample you can create a view as below.
>
> You may want to use a "seed" so you can reproduce the result if need be.
>
> data example;
> do id = 1 to 10;
> group1 = rannor(1234);
> output;
> end;
> run;
> proc surveyselect Seed=177161001 data=example method=urs reps=10
> out=work.boot outhits rate=1;
> run;
> data work.bootV / view=work.bootV;
> if 0 then set work.boot(keep=Replicate);
> Replicate = 0;
> do until(eof);
> set work.example end=eof;
> output;
> end;
> eof = 0;
> do until(eof);
> set work.boot end=eof;
> output;
> end;
> stop;
> run;
> proc print;
> run;
>
> On 8/7/07, Song <soun...@yahoo.com> wrote:
>
>
>
> > Hi All,
>
> > I have the following code:
>
> > /********************************************/
> > data example;
> > do i = 1 to 10;
> > group1 = rannor(0);
> > output;
> > end;
> > keep group1;
> > run;
>
> > data boot;
> > do sample = 1 to 10;
> > do i = 1 to nobs;
> > x = round(ranuni(0) * nobs);
> > set example
> > nobs = nobs
> > point = x;
> > output;
> > end;
> > end;
> > stop;
> > run;
> > /*****************************************/
>
> > What I would like to do is simulate my rannor data multiple times and
> > perform abootstrapto each of those simulated dataset. Can anyone
> > suggest how I might be able to combine the two data step into one with
> > the additionalsimulationvariable?
>
> > Thank,
>
> > Song- Hide quoted text -
>
> - Show quoted text -
Thank you for everyone's response. The paper by Cassell et. al was
helpful in using PROC SURVEYSELECT.
However if I wanted to simulate 1000 sets of 20 observations from a
normal distribution:
data mydata;
seed1 = 123
do sim = 1 to 1000;
do i = 1 to 20;
group1 = rannor(seed1+ sim);
output;
end;
end;
drop seed1;
run;
Then I would like to perform 1000 bootstrap reps on each of the
individual simulated dataset of 20 observations. How can I modify the
following code to account for my data?
proc surveyselect data = mydata out = boot
seed = 321
method = urs sample = 1 outhits
rep = 1000;
run;
Thanks,
Song