Date: Mon, 14 May 2007 14:39:10 +0000
Reply-To: iw1junk@COMCAST.NET
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ian Whitlock <iw1junk@COMCAST.NET>
Subject: Re: macro question.....maybe SYMPUT
Summary: An example would help
#iw-value=1
Peter,
A simple example with say several grouping variables, several analysis
variables, and handful of records would help us help you.
From your code there seems to be one grouping variable LGROUP, but the
PROC PRINT tests
where abs(&&grp&i) > 2;
which makes one think that LGROUP is the analysis variable having an
outlier > 2. This does not make a lot of sense to me. So please
give a small example.
Thanks.
Ian Whitlock
===============
Date: Mon, 14 May 2007 09:34:30 -0400
Reply-To: Peter Flom <peterflomconsulting@mindspring.com>
Sender: "SAS(r) Discussion"
From: Peter Flom <peterflomconsulting@MINDSPRING.COM>
Subject: macro question.....maybe SYMPUT
Content-Type: text/plain; charset=UTF-8
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