FOCUS AREAS

Graphics

Lab Values by Study Week
Base SAS: Graph Template Language

%let graphs='.';

%let dpi=100;
%let w=8in;
%let h=4.5in;

/*--Create labs data--*/
data labs;
label sgot="SGOT";
label aph="ALKPHOS";
label visit="Study Week";
input visit $ 1-10 treatment $ sgot aph;
datalines;
SCREENING   PLACEBO       .        108.943
WEEK 2      PLACEBO     10.2941     83.740
WEEK 4      PLACEBO     16.1765     76.423
WEEK 6      PLACEBO     17.6471     86.179
WEEK 8      PLACEBO     11.7647     67.480
WEEK 10     PLACEBO     14.7059     68.293
WEEK 12     PLACEBO     13.2353     73.171
WEEK 14     PLACEBO     12.5000     74.797
WEEK 16     PLACEBO     12.5000     76.423
SCREENING   ACTIVE      12.5000     66.667
WEEK 2      ACTIVE      17.3077     57.961
WEEK 4      ACTIVE      17.9487     68.873
WEEK 6      ACTIVE      26.9231     98.748
WEEK 8      ACTIVE      25.9615     98.211
WEEK 10     ACTIVE      27.2436    100.179
WEEK 12     ACTIVE      29.9679    104.293
WEEK 14     ACTIVE      26.9231    115.921
WEEK 16     ACTIVE      33.3333    118.605
;
run;

/*--Template for Labs graph--*/
proc template;
define statgraph panel;
begingraph;
entrytitle "Lab Values by Study Week";
layout gridded / rowgutter=5;
   layout datapanel classvars=(treatment) / rowaxisopts=(griddisplay=on)
       columnaxisopts=(tickvalueattrs=(size=7)griddisplay=on) 
       columns=1 headerLabelDisplay=Value cellheightmin=50;
      layout prototype /  cycleattrs=true;
         SeriesPlot X=visit Y=sgot / primary=true display=(markers)   markerattrs=(size=9px symbol=circlefilled)
           lineattrs=(thickness=2px) NAME="s1";
         SeriesPlot X=visit Y=aph / yaxis=y2 display=(markers)  markerattrs=(size=9px symbol=circlefilled)
           lineattrs=(thickness=2px) NAME="s2";
      endlayout;
   endlayout;
   DiscreteLegend "s1" "s2" /;
endlayout;
endgraph;
end;
run;

/*--Render Labs graph--*/
ods listing style=htmlblue gpath=&graphs image_dpi=&dpi;
ods graphics / reset width=&w height=&h imagename="LabValuesGTL_V93";
proc sgrender data=labs template="panel";
run;