FOCUS AREAS

Graphics

Vital Statistics for Patient Id
Base SAS: ODS Graphics Procedure: SGPANEL

%let gpath='.';
%let dpi=100;

ods listing style=htmlblue image_dpi=&dpi gpath=&gpath; 
ods html close;

/*--Vital Statistics Data--*/
data vs;
  length vstest2 $9;
  input VSSTRESN    VSDY    vstest2 $     id;
  datalines;
       68        -16    Diastolic     2
       68         -2    Diastolic     2
       68          1    Diastolic     2
       70         15    Diastolic     2
       68         16    Diastolic     2
       70         27    Diastolic     2
       70         29    Diastolic     2
       74         41    Diastolic     2
       60         57    Diastolic     2
       62         83    Diastolic     2
       64        114    Diastolic     2
       54        -16    Pulse         3
       57         -2    Pulse         3
       54          1    Pulse         3
       57         15    Pulse         3
       54         16    Pulse         3
       57         27    Pulse         3
       60         29    Pulse         3
       60         41    Pulse         3
       51         57    Pulse         3
        72        83    Pulse        3
        51       114    Pulse        3
       132       -16    Systolic     1
       146        -2    Systolic     1
       130         1    Systolic     1
       122        15    Systolic     1
       132        16    Systolic     1
       130        27    Systolic     1
       120        29    Systolic     1
       120        41    Systolic     1
       140        57    Systolic     1
       122        83    Systolic     1
       130       114    Systolic     1
;
run;

/*--Sort by ID--*/
proc sort data=vs out=vss;
  by id;
run;

/*--Vital Signs Panel with Inset--*/
ods graphics / reset  attrpriority=color width=5in height=3in imagename="7L_VS_Inset";
title "Vital Statistics for Patient Id = xx-xxx-xxxx"; 
proc sgpanel data=vss noautolegend nocycleattrs;
  panelby vstest2 / onepanel layout=rowlattice uniscale=column novarname spacing=10 noheader sort=data;
  refline 0 / axis=x lineattrs=(thickness=1 color=black);
  series x=vsdy y=vsstresn / group=vstest2 lineattrs=(thickness=3) nomissinggroup name='bp';
  scatter x=vsdy y=vsstresn / group=vstest2 markerattrs=(symbol=circlefilled size=11);
  scatter x=vsdy y=vsstresn / group=vstest2 markerattrs=(symbol=circlefilled size=5 color=white);
  inset vstest2 / nolabel position=topright textattrs=(size=9);
  keylegend 'bp' / title='Vitals:' across=3 linelength=20;
  rowaxis grid display=(nolabel) valueattrs=(size=7) labelattrs=(size=8);
  colaxis grid label='Study Days' valueattrs=(size=7) labelattrs=(size=8);
  run;

title;