Hello SAS Experts, Masters and Gurus! I am trying to create a forestplot-like graph, using PROC TEMPLATE. Most things work as I expect to work. However, I have 2 questions: (1) I would like to ident the "subgroup" labels on the y-axis, like this: Gender Male Female ... (2) I would like the lines (mean +/- s.e.) to alternate between solid and dashed (so, gender has lines black and solid, race has lines gray and dashed...) My code is below and the sample data is attached: /*hoping to get the leading-blanks to stay in the format*/ data _null_; call symput('blk','A0'X); run; proc format; value $ lab 'Male' = "&blk.&blk. Male" 'Female' = "&blk.&blk. Female" 'Black' = "&blk.&blk. Black" 'White' = "&blk.&blk. Non-Black" ' 43 years' = "&blk.&blk. 43 years" ' 66 years' = "&blk.&blk. 66 years" ' 82 years' = "&blk.&blk. 82 years" ; quit; proc template; define statgraph sgdesign; dynamic _ESTIMATE _LABEL _GRP_VAR _ESTIMATE2 _UPPER _LOWER; begingraph / designwidth=1408 designheight=807; DiscreteAttrMap name="__ATTRMAP__"; Value "1" / markerattrs=( color=black symbol=circle) lineattrs=( color=black pattern=2); Value "2" / markerattrs=( color=grayaa symbol=plus) lineattrs=( color=grayaa pattern=3); Value "3" / markerattrs=( color=black symbol=circle) lineattrs=( color=black pattern=2); EndDiscreteAttrMap; DiscreteAttrVar attrvar=my_grp var=_grp_var attrmap="__ATTRMAP__"; layout lattice / rowdatarange=data columndatarange=data rowgutter=10 columngutter=10; layout overlay / xaxisopts=( display=(TICKS TICKVALUES LINE LABEL ) griddisplay=off label=('Mean (95% Confidence Interval) of eGFR Slope') labelattrs=(size=14 style=NORMAL weight=BOLD ) tickvalueattrs=(size=14 )) yaxisopts=( reverse=true display=(TICKS TICKVALUES LINE ) griddisplay=off labelattrs=GraphTitleText(size=14 ) tickvalueattrs=(size=14 ) gridattrs=(color=CX848284 pattern=2 thickness=1 )); scatterplot x=_ESTIMATE y=_LABEL / group=my_grp datalabel=_ESTIMATE2 datalabelposition=TOP DATALABELATTRS = (size = 14) xerrorupper=_UPPER xerrorlower=_LOWER name='scatter' markerattrs=(symbol=CIRCLEFILLED size=15 weight=bold ) errorbarattrs=(thickness=2 ); referenceline x = 0 / lineattrs = (thickness=3 pattern=2 color=CX848284); endlayout; endlayout; endgraph; end; run; proc sgrender data = have template = sgdesign; dynamic _ESTIMATE = "ESTIMATE" _LABEL = "LABEL" _GRP_VAR = "'GRP_VAR'n" _ESTIMATE2 = "ESTIMATE" _UPPER = "UPPER" _LOWER = "LOWER"; run; Thank you!!!!!
... View more