The SAS Output Delivery System and reporting techniques

SGPLOT, lineattrs for specific measures

Reply
Regular Contributor
Regular Contributor
Posts: 170

SGPLOT, lineattrs for specific measures

Hello all-
One last question-
How I request a specific lineattrs & markerattrs for a specific unit of measure so that if unit A then:
lineattrs=(pattern=solid thickness=2px color=blue)
markerattrs=(symbol=circlefilled )

Thank you again.
LB
Regular Contributor
Regular Contributor
Posts: 170

Re: SGPLOT, lineattrs for specific measures

the whole code might help:
I want to change just one unit...

proc sgplot data=BASIC_OUT_II ;
WHERE UNIT1 IN ('Adult Overall Composite', 'ICU', 'NICU','ICC','MZICU') and _type_ in (7,11) and CURRENTFY=1;


series x=Moi2 y=CRBSI_RATE /
datalabel=CRBSIgraph
lineattrs=(pattern=solid thickness=2px)
markerattrs=(symbol=circlefilled )
markers group=UNIT1
name="UNITS";
keylegend "UNITS" /
position=bottom location=outside across=5 title='UNIT:';
yaxis label='CRBSI Rate per 1000 dd' GRID VALUES = (0 TO 15 BY 2.5);
xaxis LABEL=' ' DISPLAY=(NOTICKS);
REFLINE 4.56 / TRANSPARENCY = .1 LINEATTRS=(pattern=dot thickness=3px color=green)
LABEL = ('UCSF IAP Goal:4.56') LABELLOC= INSIDE ;
run;
ODS GRAPHICS OFF;
SAS Super FREQ
Posts: 896

Re: SGPLOT, lineattrs for specific measures

There is currently not a away to assign graph attributes directly to a data value; however, assuming your data is sorted by UNIT1 and Moi2, you could put those attributes in a style element that would get picked up by UNIT A. For example,

proc template;
define style styles.unitstyle;
parent=styles.listing; /* or whatever style you're using */
style GraphData1 from GraphData1 / /* The number depends on the position */
linestyle=1 /* of the unit in your list of units */
linethickness=2
contrastcolor=blue
markersymbol=circlefilled
;
run;

ods listing style=unitstyle; /* or whatever destination you're using */
SAS Super FREQ
Posts: 896

Re: SGPLOT, lineattrs for specific measures

One correction to my proc template code: I missed an END;. The corected code is below:

proc template;
define style styles.unitstyle;
parent=styles.listing; /* or whatever style you're using */
style GraphData1 from GraphData1 / /* The number depends on the position */
linestyle=1 /* of the unit in your list of units */
linethickness=2
contrastcolor=blue
markersymbol=circlefilled
;
end;
run;

ods listing style=unitstyle; /* or whatever destination you're using */
Ask a Question
Discussion stats
  • 3 replies
  • 150 views
  • 0 likes
  • 2 in conversation