Hello all-
another possible brain teaser that any assistance would be much appreciated-
I have a macro that takes all the units and produces a graph for each unit. So far, no difficulty except that I would like to change two things:
Based on a specific unit I would to be able to change the refline statement as needed.
Also, is there is any way to use if/then statements in the footnotes of each graph that incorporate data from other macros-
The code is shown below, any assistance much appreciated!
LB
%macro split (data=, var=);
proc sort data=&data(keep=&var) out=values nodupkey;
by &var;
run;
data _null_;
set values end=last;
call symputx('site'||left(_n_),&var);
if last then call symputx('count',_n_);
run;
%put _local_;
DATA _NULL_ ;
select(&var);
%do i=1 %to &count;
/*CRBSI GRAPHS */
ODS GRAPHICS ON /IMAGEFMT=PNG HEIGHt=3in width=5in SCALE=OFF ANTIALIAS=ON IMAGENAME="CRBSI_&&site&i" BORDER=NO;
title "&&site&i";
proc sgplot data=BASIC_OUT_II NOAUTOLEGEND ;
WHERE UNIT1 IN ("&&site&i") and _type_ =7 and moi>'30Aug07'd;
series x=Moi2 y=CRBSI_RATE /
datalabel=CRBSIgraph
lineattrs=(pattern=solid thickness=2px color=blue)
markerattrs=(symbol=circlefilled )
markers group=UNIT1;
yaxis label='CRBSI Rate per 1000 DD' GRID VALUES = (0 TO 15 BY 2.5);
xaxis label =' ';
REFLINE 4.56 / TRANSPARENCY = .1 LINEATTRS=(pattern=dot thickness=3px color=green)
LABEL = ('UCSF IAP Goal:4.56') LABELLOC=OUTSIDE ;
REFLINE .5 / TRANSPARENCY = .1 LINEATTRS=(pattern=dot thickness=3px color=red)
LABEL = ('NHSN 25%ile (.5)' ) LABELLOC=OUTSIDE ;
run;
footnote goes here.
ODS GRAPHICS OFF;