Date: Wed, 6 Sep 2006 11:29:31 -0700
Reply-To: David L Cassell <davidlcassell@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David L Cassell <davidlcassell@MSN.COM>
Subject: Re: A question about how to delete all the observations using code
In-Reply-To: <200609020801.k824deUR027779@mailgw.cc.uga.edu>
Content-Type: text/plain; format=flowed
slhappyls@GMAIL.COM wrote back:
>My code is as follows
>
>
>%macro selectk(maxk=20, dataset=ms.trainset);
>
> %*init setting;
> data ms.selectknn;
> input k misrate1 misrate2 mistotal;
> run;
>
> %do i=3 %to &maxk. %by 2;
>
> ods listing close;
>
> ods output errorcrossval=ms.tmp;
> proc discrim data=&dataset. method=npar k=&i. crossvalidate;
> class class;
> var hba -- mlogp;
> run;
>
> data ms.tmp1;
> set ms.tmp;
> if type = 'Rate';
> k=&i.;
> misrate1=_1;
> misrate2=_2;
> mistotal=total;
> drop _1 _2 total type;
> run;
>
>
> data ms.selectknn;
> set ms.selectknn ms.tmp1;
> run;
>
> ods listing;
>
> %end;
>
> proc print data=ms.selectknn;
> run;
>
>%mend selectk;
>
>
>
>every time I use the macro %selectk the dataset ms.selectknn will repeat. I
>have to delete all the observations in ms.selectknn. How could I do it
There is no need to go to the trouble of figuring out how to delete
all the records in your data set. Just delete the data set. You don't
have to create it in a particular form with particular variables. Your
MS.TMP1 data set does all that for you.
That said, I think you are:
[1] overdoing it on the cross-validation efforts;
and
[2] not looking into changing the nature of the kernel in your
nonparametric estimation.
So I think that you need to drop the macro programming until you
take care of the statistical side of the problem first.
HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
Get real-time traffic reports with Windows Live Local Search
http://local.live.com/default.aspx?v=2&cp=42.336065~-109.392273&style=r&lvl=4&scene=3712634&trfc=1