Date: Tue, 9 Jun 2009 19:21:44 +0800
Reply-To: Murphy Choy <goladin@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Murphy Choy <goladin@GMAIL.COM>
Subject: Re: Sampling without replacement
In-Reply-To: <d6a0d8f10906090320x3cc13660ic170085ce9ed6a70@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Hi Karma,
Agreed. I am merely suggesting a possibility.
Regards,
Murphy
On Tue, Jun 9, 2009 at 6:20 PM, karma <dorjetarap@googlemail.com> wrote:
> Hi Murphy,
>
> I think you should store the results of ranuni in a temp variable
> before splitting the dataset as calling the ranuni function again will
> return a new value. Otherwise dataset c will on average contain only
> half the number of the records in dataset b.
>
>
> data a b c;
> set Multi_Strat1_List;
> _temp = ranuni(12345) ;
> if _temp <= 0.33 then output a;
> else if _temp <= 0.66 then output b;
> else output c;
> run ;
>
>
>
> 2009/6/9 Murphy Choy <goladin@gmail.com>:
> > Hi,
> >
> > Why not use data step?
> >
> > data a b c;
> > set Multi_Strat1_List;
> >
> > if ranuni(12345) <= 0.33 then output a;
> > else if ranuni(12345) <= 0.66 then output b;
> > else output c;
> >
> > run;
> >
> > Regards,
> > Murphy
> >
> > On Tue, Jun 9, 2009 at 5:39 PM, fabergoogle
> > <fabrizio_marrama@bradycorp.com>wrote:
> >
> >> Hi all,
> >>
> >> I want to create 3 different samples whose union should give me back
> >> the whole dataset.
> >> Therefore an individual can only belong to one of those 3 samples. He
> >> cannot appear in any of the other two samples.
> >> I applied the proc surveyselect specifying rep=3. I noticed that an
> >> individual is present in 2 samples. Why?
> >>
> >> How can I have 3 different samples?
> >>
> >> Thank you.
> >>
> >>
> >> PROC SURVEYSELECT data = Multi_Strat1_List
> >> out = Multi_Strat1_Control_Sample
> >> method = srs
> >> rep=3
> >> seed = 735119000
> >> sampsize = 500;
> >> strata Deciles ContRev_Band;
> >> RUN;
> >>
> >
> >
> >
> > --
> > Regards,
> > Murphy Choy
> >
> > Certified Advanced Programmer for SAS V9
> > Certified Basic Programmer for SAS V9
> > DataShaping Certified SAS Professional
> >
>
--
Regards,
Murphy Choy
Certified Advanced Programmer for SAS V9
Certified Basic Programmer for SAS V9
DataShaping Certified SAS Professional
|