BookmarkSubscribeRSS Feed
xinjian
Calcite | Level 5

Dear all,

I want to create a graph like attached from reference.  

Reference graph.png

below is my data:

Status ID sbp dbp
normal 46 125 72
normal 53 134 63
low 54 114 71
normal 59 126 72
normal 66 167 85
normal 78 185 80
normal 79 147 94
normal 80 169 91
normal 83 129 73
low 90 122 69
normal 93 153 89
normal 100 147 77
normal 109 126 71
low 110 152 70
normal 111 133 77
normal 113 130 77
normal 115 152 86
low 117 135 79
normal 120 144 73
normal 128 113 77

 

my syntax is:

data want;

set A;

if 0<sbp<140 or 0<dbp<90 then combp=0;/*normal group*/
if sbp>=140 or dbp>=90 then combp=1;/*hypertension group*/

proc gplot data=want;  
plot ( sbp dbp)*ID/overlay;
run;

 

I have not figured out using variable 'combp' to split two groups and highlight status 'low' in graph. Is it possible to use my data to created same kind of reference graph?

Thanks in advance.

 

 

3 REPLIES 3
Rick_SAS
SAS Super FREQ

Your image is too small for me to see the details, but it looks somewhat like a waterfall plot that is used in clinical studies. Look at the article "How to create a waterfall plot in SAS" and see if you can adapt that technique to your data.

Jay54
Meteorite | Level 14
Looks like you can use a HIGHLOW plot in the SGPLOT procedure.
Jay54
Meteorite | Level 14

Here is how you can use the HIGHLOW plot to create such a graph.  Data uses sashelp.heart (age> 59) sorted by ascending Systolic, with Reference Lines at 80 and 120.

 

BP.png

title 'Individual Systolic and Diastolic Blood Pressure';
proc sgplot data=heart2 noborder nowall;
highlow x=id high=systolic low=diastolic / type=line;
refline 80 120;
xaxis display=none;
yaxis min=0 grid;
run;

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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