FOCUS AREAS

Graphics

Cholesterol by Death Cause
Base SAS: ODS Graphics Procedure: SGPLOT

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

ods html close;
ods listing gpath=&gpath image_dpi=&dpi;
title;

proc template;
   define style styles.blueBG;
      parent = Styles.htmlblue;
  	  style graphbackground  from graphbackground
  	     "Abstract colors used in graph styles" /
  		 color   = cxf0f0f7;
   end;
run;

/*--Subset Heart Dataset--*/
data heart;
  set sashelp.heart(keep=deathcause cholesterol sex ageatstart 
                    where=(deathcause not in ('Other', '')  
                           and ageatstart > 50));
  if cholesterol ne .;
  run;

/*--Discrete X Axis--*/
ods html close;
ods listing style=styles.blueBG image_dpi=&dpi gpath=&gpath;
ods graphics / reset width=5in height=3.75in imagename='Jitter_94';
title 'Cholesterol by Death Cause';
footnote j=l h=0.9 'This graphs uses jitter on discrete X axis';
proc sgplot data=heart noautolegend;
  scatter x=deathcause y=cholesterol / jitter 
          markerattrs=graphdata1(size=9 symbol=circlefilled)
      filledoutlinedmarkers markeroutlineattrs=(thickness=0) 
      markerfillattrs=graphdata1 dataskin=sheen;
  vbox cholesterol / category=deathcause fillattrs=(transparency=0.5) nooutliers;
  xaxis display=(nolabel);
  yaxis grid;
  run;

title;
footnote;