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?
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
Just add more statements. In particular, put a REFLINE statement after the PROC statement.
Statements listed first get displayed first.
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
Thank you both! That definitely helps!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.