I am attempting to make a "waterfall" plot with the NEEDLE interpolation in PROC GPLOT. My plot is divided into two different groups. I wanted the positive group to be blue and the negative group to be red. Here is what I have attempted:
axis1 label=(angle=90 'Best Percent Change in Lesion Size') order=(-100 to 150 by 50) minor=(n=4);
axis2 label=(' ') value=none major=none minor=none;
proc gplot data=waterfall;
plot ploty1*n ploty2*n / overlay vaxis=axis1 haxis=axis2;
symbol1 interpol=Needle value=none width=4 color=blue;
symbol2 interpol=Needle value=none width=4 color=red;
run;
I am not at all familiar with annotations, but I am sure I could do something with that. I just have no idea where to start.
This is not my full data, but here is an idea of how it looks:
| brpercent | posneg | n | ploty1 | ploty2 |
|---|---|---|---|---|
| 2.564 | Positive | 1 | 2.564 | |
| 2.083 | Positive | 2 | 2.083 | |
| 1.333 | Positive | 3 | 1.333 | |
| 0 | Positive | 4 | 0 | |
| -5.263 | Positive | 5 | -.263 | |
| -30 | Positive | 6 | -30 | |
| -31.429 | Positive | 7 | -31.429 | |
| -36.842 | Positive | 8 | -36.842 | |
| -40 | Positive | 9 | -40 | |
| -50 | Positive | 10 | -50 | |
| 150 | Negative | 11 | 150 | |
| 142.857 | Negative | 12 | 142.857 | |
| 78.152 | Negative | 13 | 78.152 | |
| 58.065 | Negative | 14 | 58.065 | |
| 52.174 | Negative | 15 | 52.174 | |
| -3.704 | Negative | 16 | -3.704 | |
| -4 | Negative | 17 | -4 | |
| -4.762 | Negative | 18 | -4.762 | |
| -7.143 | Negative | 19 | -7.143 | |
| -18.75 | Negative | 20 | -18.75 |
Here's an example where I've used Proc Gchart and Annotate to create a waterfall chart - I think you can re-use this technique to get the graph you're wanting...
Here's an example where I've used Proc Gchart and Annotate to create a waterfall chart - I think you can re-use this technique to get the graph you're wanting...
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.