FOCUS AREAS

Graphics

interval box plot
Base SAS: ODS Graphics Procedure: SGPLOT

/* This program requires SAS 9.4 TS Level 1M2 or later */
%let gpath='.';
%let dpi=100;

data QTcData;
  drop i;
  do Week=0, 2, 4, 8, 12, 16, 20, 24, 28; 
    risk=.;
    do i=1 to 10;
      QTc=90-180*ranuni(2); Drug='Drug A'; output;
      QTc=90-180*ranuni(2); Drug='Drug B'; output;
    end;
    do i=1 to 20;
      QTc=90-60*ranuni(2); Drug='Drug A'; output;
      QTc=90-90*ranuni(2); Drug='Drug B'; output;
    end;
    risk=floor(280-5*week*ranuni(2)); Drug='Drug A'; output;
    risk=floor(410-6*week*ranuni(2)); Drug='Drug B'; output;
  end;
run;

proc format;
  value qtcweek 
    28='Max';
  ;
run;

ods html close;

ods listing gpath=&gpath image_dpi=&dpi;
ods graphics / reset attrpriority=color width=5in height=3.75in 
    imagename='QTc_Change_From_Baseline_SG';
title 'QTc Change over Time by Treatment';
proc sgplot data=QTcData;
  format week qtcweek.;
  refline 26 / axis=x;
  refline 0 30 60 / axis=y transparency=0.6;
  vbox qtc / category=week group=drug groupdisplay=cluster nofill;
  xaxistable risk / class=drug colorgroup=drug ;
  xaxis display=(nolabel) type=linear values=(0 2 4 8 12 16 20 24 28) max=29 valueshint;
  yaxis label='QTc change from baseline' values=(-120 to 90 by 30) ;
  keylegend / title='' linelength=20;
 run;

title;