Date: Mon, 14 May 2007 10:11:53 -0400
Reply-To: "data _null_;" <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_;" <datanull@GMAIL.COM>
Subject: Re: macro question.....maybe SYMPUT
In-Reply-To: <18406012.1179149670665.JavaMail.root@mswamui-bichon.atl.sa.earthlink.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi Peter,
I'm thinking you may not need any percent signs or ampersands at all.
Especially if you follow Toby's suggestion and normalized your data.
proc print data = standardized;
var maf1d1 disc1 disc2 disc3 disc4;
where abs(maf1d1) > 2;
run;
I don't completely understand the input and output from the example
you gave above. I understand the MAF1D1 is the standardized value of?
MAF1D1? what are DISC1-DISC4. Were is the grouping variable. Can
you give more details.
On 5/14/07, Peter Flom <peterflomconsulting@mindspring.com> wrote:
> Hello again
>
> I am gradually trying to figure out some basic macros, working through Art Carpenter's excellent book on the subject (I've got the first edition).
>
> Unfortunately, what I have to do now is (at least for me) advanced....
>
> I have a data set with 900 variables and about 1000 people. These people can be grouped in various ways. Now, my boss would like to see a list of cases, by group, where the standardized values are extreme, for each of the 900 variables. I've created the standardized variables using PROC STANDARD.
>
> Now, if I wanted to do what she wants for ONE variable, it would be easy
>
> proc print data = standardized;
> var maf1d1 disc1 disc2 disc3 disc4;
> where abs(maf1d1) > 2;
> run;
>
> but with 900 variables, I am not sure what to do.
>
> On page 71 of Art's book there is a macro to plot things by region, which I tried to adapt.....but....
>
> here's my code
>
> <<<<<
>
> %macro outlie;
> data _NULL_;
> set standardized;
> by lgroup;
> if first.lgroup then
> do;
> i + 1;
> III = left(put(i,3.));
> call symput('grp'||III, lgroup);
> call symput('total', III);
> end;
> run;
>
>
> %do i = 1 %to &total;
> proc print data = standardized;
> var &&grp&i lgroup disc_use1-disc_use4;
> where abs(&&grp&i) > 2;
> run;
> %end;
> %mend outstand;
> %outlie;
> >>>>>
>
> But I get errors....
>
> variable A not found
> variable N not found
>
>
> I don't understand.....what are variable A and N?
>
>
> TIA as always
>
> Peter
>
|