data WORK.PLOT ;
infile datalines4 dsd missover dlm=',' ;
length DAY GEOMEAN LCLM UCLM 8. ;
input DAY GEOMEAN LCLM UCLM ;
datalines4 ;
1,5.851,5.721,5.983
15,10.103,8.531,11.965
29,17.723,14.523,21.628
57,25.449,20.171,32.108
71,76.898,62.926,93.972
85,119.914,101.658,141.447
;;;;
run ;
proc sql noprint ;
select distinct DAY into :XAxisValues separated by ' ' from WORK.PLOT order by DAY ;
quit ;
%put XAxisValues: &XAxisValues. Days ;
** Style to be used for the plot ** ;
/*this SAS style can be used: STYLES.Journal;*/
ods path (PREPEND) WORK.GRAPH ;
proc template ;
define statgraph TestSymbolChar / store=WORK.GRAPH ;
mvar GraphTitle EmDashHexa EmDashSize XAxisValues ;
nmvar SymVOffset ;
dynamic XVar YMean YLowBound YUpBound ;
begingraph ;
symbolchar name=EmDash char=EmDashHexa / /*textattrs=(size=20pt)*/ hoffset=0 voffset=SymVOffset /*+0.1*/ ;
entrytitle textattrs=(size=10pt weight=bold) GraphTitle ;
layout overlay / xaxisopts=(label='Day' linearopts=(tickvaluelist=XAxisValues))
yaxisopts=(griddisplay=on type=log logopts=(base=10 Thresholdmax=1 Thresholdmin=1 minorticks=true minortickcount=8 minorgrid=true)
label='Geometric Mean (95%CI)' griddisplay=on) ;
scatterplot x=XVar y=YMean / markerattrs=(symbol=EmDash size=EmDashSize weight=bold color=black) errorbarcapshape=serif
errorbarattrs=(thickness=1pt color=black) yerrorlower=YLowBound yerrorupper=YUpBound name="GeoMean" ;
referenceline y=77 / lineattrs=(color=red pattern=2) curvelabel='77' curvelabelattrs=(color=black size=6) ;
referenceline y=120 / lineattrs=(color=red pattern=2) curvelabel='120' curvelabelattrs=(color=black size=6) ;
endlayout ;
endgraph ;
end ;
quit ;
*** Path of the template catalogs *** ;
ods path SASUSER.TEMPLAT(UPDATE) SASHELP.TMPLMST(READ) WORK.MYTEMP(READ) WORK.GRAPH(READ) ;
%MACRO testSymbolChar( /* Test different Symbol to show geometric mean as a straight line */
EmDashHexa=, /* Hexadecimal code for symbol character */
EmDashSize=, /* Size of the symbol character */
SymVOffset=0, /* Vertical Offset of the symbol character */
imagename=, /* Name of the PNG file */
GraphTemplate=TestSymbolChar /* Template to use for SGRENDER */
) ;
%** SAS SGRender ** ;
%let GraphTitle=Using &EmDashHexa. with &EmDashSize. as a size for Symbol Char ;
%let FigureRoot=C:\Temp ;
option center ;
ods listing close ;
ods graphics on / reset=index imagename="&imagename." height=10cm width=16cm noborder ;
ods html style=styles.journal2 image_dpi=150 gpath="&FigureRoot." path="&FigureRoot." (url=none) file="output.html" ;
%*goptions reset=all ;
ods graphics / outputfmt=png ;
proc sgrender data=WORK.PLOT template=&GraphTemplate. description='' ;
dynamic XVar='DAY' YMean='GEOMEAN' YLowBound='LCLM' YUpBound='UCLM' ;
run ;
ods html close ;
ods graphics off ;
ods listing ;
%MEND testSymbolChar ;
/*
%let EmDashHexa='2012'x ;* Figure Dash * ;
%let EmDashHexa='2013'x ;* En Dash * ;
%let EmDashHexa='2014'x ;* Em Dash * ;
%let EmDashHexa='2015'x ;* Horizontal Bar * ;
%let EmDashHexa='002D'x ;* Hyphen-Minus * ;
%let EmDashHexa='0336'x ;* Combining Long Stroke Overlay * ;
%let EmDashHexa='2500'x ;* Box Drawings Light Horizontal * ;
%let EmDashHexa='25AC'x ;* Black Rectangle * ;
%let EmDashHexa='A7F7'x ;* Undefined * ;
*/
%testSymbolChar(EmDashHexa=%bquote('2014'x),EmDashSize=%bquote(),imagename=TestEmDashSizeEmpty) ;
%testSymbolChar(EmDashHexa=%bquote('2014'x),EmDashSize=%bquote(12pt),imagename=TestEmDashSize12pt) ;
%testSymbolChar(EmDashHexa=%bquote('2014'x),EmDashSize=%bquote(40),imagename=TestEmDashSize40) ;
%testSymbolChar(EmDashHexa=%bquote('2015'x),EmDashSize=%bquote(),imagename=TestHBarSizeEmpty) ;
%testSymbolChar(EmDashHexa=%bquote('2015'x),EmDashSize=%bquote(12pt),imagename=TestHBarSize12pt) ;
%testSymbolChar(EmDashHexa=%bquote('2015'x),EmDashSize=%bquote(40),imagename=TestHBarSize40) ;
%testSymbolChar(EmDashHexa=%bquote('002D'x),EmDashSize=%bquote(),imagename=TestHyphenSizeEmpty) ;
%testSymbolChar(EmDashHexa=%bquote('002D'x),EmDashSize=%bquote(12pt),imagename=TestHyphenSize12pt) ;
%testSymbolChar(EmDashHexa=%bquote('002D'x),EmDashSize=%bquote(40),imagename=TestHyphenSize40) ;
%testSymbolChar(EmDashHexa=%bquote('0336'x),EmDashSize=%bquote(),imagename=TestCLSOSizeEmpty) ;
%testSymbolChar(EmDashHexa=%bquote('0336'x),EmDashSize=%bquote(12pt),imagename=TestCLSOSize12pt) ;
%testSymbolChar(EmDashHexa=%bquote('0336'x),EmDashSize=%bquote(40),imagename=TestCLSOSize40) ;
%testSymbolChar(EmDashHexa=%bquote('2012'x),EmDashSize=%bquote(),imagename=TestFigDashSizeEmpty) ;
%testSymbolChar(EmDashHexa=%bquote('2012'x),EmDashSize=%bquote(12pt),imagename=TestFigDashSize12pt) ;
%testSymbolChar(EmDashHexa=%bquote('2012'x),EmDashSize=%bquote(40),imagename=TestFigDashSize40) ;
%testSymbolChar(EmDashHexa=%bquote('2013'x),EmDashSize=%bquote(),imagename=TestEnDashSizeEmpty) ;
%testSymbolChar(EmDashHexa=%bquote('2013'x),EmDashSize=%bquote(12pt),imagename=TestEnDashSize12pt) ;
%testSymbolChar(EmDashHexa=%bquote('2013'x),EmDashSize=%bquote(40),imagename=TestEnDashSize40) ;
%testSymbolChar(EmDashHexa=%bquote('2500'x),EmDashSize=%bquote(),imagename=TestBDLHSizeEmpty) ;
%testSymbolChar(EmDashHexa=%bquote('2500'x),EmDashSize=%bquote(12pt),imagename=TestBDLHSize12pt) ;
%testSymbolChar(EmDashHexa=%bquote('2500'x),EmDashSize=%bquote(40),imagename=TestBDLHSize40) ;
%testSymbolChar(EmDashHexa=%bquote('25AC'x),EmDashSize=%bquote(),imagename=TestBlackRectizeEmpty) ;
%testSymbolChar(EmDashHexa=%bquote('25AC'x),EmDashSize=%bquote(12pt),imagename=TestBlackRectSize12pt) ;
%testSymbolChar(EmDashHexa=%bquote('25AC'x),EmDashSize=%bquote(40),imagename=TestBlackRectSize40) ;
%testSymbolChar(EmDashHexa=%bquote('A7F7'x),EmDashSize=%bquote(),imagename=TestUndefSizeEmpty) ;
%testSymbolChar(EmDashHexa=%bquote('A7F7'x),EmDashSize=%bquote(12pt),imagename=TestUndefSize12pt) ;
%testSymbolChar(EmDashHexa=%bquote('A7F7'x),EmDashSize=%bquote(40),imagename=TestUndefSize40) ;
/* Not so bad solution */
%testSymbolChar(EmDashHexa=%bquote('2500'x),EmDashSize=%bquote(20),imagename=TestBDLHSize20) ;
%testSymbolChar(EmDashHexa=%bquote('2014'x),EmDashSize=%bquote(20),SymVOffset=0.08,imagename=TestEmDashSize20Offset) ;
... View more