%let gpath='C:\';
%let dpi=200;
ods html close;
ods listing gpath=&gpath image_dpi=&dpi;
/*--Generate random data--*/
Data Pulmonary;
length Pulmonary $8;
label Pulmonary='Pulmonary Embolism';
drop i;
do Pulmonary='Absent', 'Present';
do i=1 to 100;
if pulmonary='Present' then shock=0.5+0.7*ranuni(3);
else shock=0.2+0.7*ranuni(3);
output;
end;
do i=1 to 10;
shock=1+0.7*ranuni(3); output;
end;
end;
run;
/*--Compute statistics--*/
proc means data=Pulmonary noprint;
class pulmonary;
var shock;
output out=Pulmonary_Pct(where=( _type_ > 0))
mean=Mean
median=Median
p5=P5
p95=P95;
run;
/*proc print; run;*/
/*--Box Plot--*/
ods graphics / reset width=5in height=3in imagename='PulmonaryBox_93';
title 'Shock Index for Subjects with and without a Pulmonary Embolism';
footnote j=l 'Data is simulated';
proc sgplot data=Pulmonary;
vbox shock / category=pulmonary boxwidth=0.2 fillattrs=(color=lightblue);
yaxis display=(noticks nolabel noline) min=0 max=2 grid;
run;
/*--Scatter Limit Plot--*/
ods graphics / reset width=5in height=3in imagename='PulmonaryScatter_93';
title 'Shock Index for Subjects with and without a Pulmonary Embolism';
footnote j=l 'Data is simulated';
proc sgplot data=Pulmonary_Pct noautolegend;
scatter x=pulmonary y=mean / yerrorlower=p5 yerrorupper=p95 markerattrs=(symbol=circlefilled color=black);
scatter x=pulmonary y=mean / markerattrs=(symbol=circlefilled color=lightblue size=6);
yaxis display=(noticks nolabel noline) min=0 max=2 grid;
run;
/*--Scatter Limit Plot with HighLow--*/
ods graphics / reset width=5in height=3in imagename='PulmonaryScatterHighLow_93';
title 'Shock Index for Subjects with and without a Pulmonary Embolism';
footnote j=l 'Data is simulated';
proc sgplot data=Pulmonary_Pct noautolegend;
highlow x=pulmonary low=mean high=mean;
scatter x=pulmonary y=mean / yerrorlower=p5 yerrorupper=p95 markerattrs=(symbol=circlefilled color=black);
scatter x=pulmonary y=mean / markerattrs=(symbol=circlefilled color=lightblue size=6);
yaxis display=(noticks nolabel noline) min=0 max=2 grid;
run;
/*--Scatter Limit Plot with cluster group--*/
ods graphics / reset width=5in height=3in imagename='PulmonaryScatterGroup_93';
title 'Shock Index for Subjects with and without a Pulmonary Embolism';
footnote j=l 'Data is simulated';
proc sgplot data=Pulmonary_Pct noautolegend;
scatter x=pulmonary y=mean / yerrorlower=p5 yerrorupper=p95 group=pulmonary groupdisplay=cluster
markerattrs=graphdatadefault errorbarattrs=graphdatadefault;
yaxis display=(noticks nolabel noline) min=0 max=2 grid;
run;
title;
footnote;