BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
marianhabesland
Calcite | Level 5

I am creating a vertical box plot and want to add some specific features. So far I have produced this code that creates the general structure that I want.

 

title "Diastolic Blood Pressure by Ethnicity/Race Group" bold;
proc sgplot data = HypAnl.HypPrimanl;
vbox DBP / group = EthRaceCd ;
run;

 

I now want to add some specific features, but am unsure exactly where in code they actually go. For example, I want a reference line called "Hypertension Threshold" that runs at 90 on the Y-axis. Where in the code do I add these kind of features?

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

title "Diastolic Blood Pressure by Ethnicity/Race Group" bold;
proc sgplot data = HypAnl.HypPrimanl;

refline 90;
vbox DBP / group = EthRaceCd ;
run;

 

This will make the reference line draw behind the boxes. Move the REFLINE statement after the VBOX statement if you want them drawn in front of the boxes. There are a number of options on the REFLINE statement to enhance its appearance.

 

Hope this helps!

Dan

View solution in original post

3 REPLIES 3
WarrenKuhfeld
Rhodochrosite | Level 12

Just add more statements.  In particular, put a REFLINE statement after the PROC statement.

 

http://go.documentation.sas.com/?docsetId=grstatproc&docsetTarget=n0ezn6n9coszztn100iyzhfvwnhp.htm&d...

 

Statements listed first get displayed first.

DanH_sas
SAS Super FREQ

title "Diastolic Blood Pressure by Ethnicity/Race Group" bold;
proc sgplot data = HypAnl.HypPrimanl;

refline 90;
vbox DBP / group = EthRaceCd ;
run;

 

This will make the reference line draw behind the boxes. Move the REFLINE statement after the VBOX statement if you want them drawn in front of the boxes. There are a number of options on the REFLINE statement to enhance its appearance.

 

Hope this helps!

Dan

marianhabesland
Calcite | Level 5

Thank you both! That definitely helps!

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
  • 1051 views
  • 0 likes
  • 3 in conversation