Date: Fri, 8 May 2009 18:16:18 -0400
Reply-To: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject: Re: split sample dataset into several folds for cross validation
in SAS
In-Reply-To: <9b23047a-7984-403a-a49b-268587ea1bfe@q2g2000vbr.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"
Have you tried the SAMPSIZE option instead of SAMPRATE? You could compute that and save it to a SAS Macro variable.
S
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Gary
Sent: Friday, May 08, 2009 8:37 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: split sample dataset into several folds for cross validation in SAS
Thanks for the reply. I tried, and I can divide the sample into 10 folds, but the problem is that in each folder there is different percentage of response. In my case, sample is 36000, and the total response is 240. After I split into 10 folds, one fold could have 38 response and the other one could have only 18. I tried surveyselect as suggested by David Cassell, but still have the same problem.
%let K=10;
%let rate=%sysevalf((&K-1)/&K);
proc surveyselect data=sampledata
out=xv
seed=1234567
samprate=&RATE
outall
rep=&K;
strata response ;
run;
Any suggestion?
|