BookmarkSubscribeRSS Feed
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
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
3 REPLIES 3
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
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;
DanH_sas
SAS Super FREQ
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 */
DanH_sas
SAS Super FREQ
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 */

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1849 views
  • 0 likes
  • 2 in conversation