Hey fellow SASers!
The other day I encounter this "rain cloud" plot idea. That one which plots: kernel density estimates, data values, and box-and-whiskers plot together. Giving a result like below:
I did some googling but couldn't find how to get one in Base SAS... So I wrote this macro named %rainCloudPlot().
Now you just write:
%rainCloudPlot(sashelp.cars,DriveTrain,Invoice)
and get a picture like the one above.
Macro is available in the BasePlus package (https://github.com/yabwon/SAS_PACKAGES/)
Macro documentation is here: https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#raincloudplot-macro
I hope you will find it useful. Any feedback is welcome as well!
All the best
Bart
I'm glad you like it. 🙂
Bart
Very nice, @yabwon ! I was shocked to see you did that with SGPLOT, and not GTL. When I started with ODS graphics, I spent the first year or so mostly using GTL. But at some point, I realized how much was possible with SGPLOT, and now I rarely write GTL. This is a great example of "if you can dream it you can make it" with SGPLOT. Very nice.
I did it with SGPLOT because I don't feel confident with GTL (though I would like to feel) 🙂
Bart
Great job!
I will use it in my work in BAU project!
That's good news 🙂
B.
Bart,
I really like the raincloud plots. However, when I run the %include packages(SPFinit.sas); I geta whole bunch of errors like those below. Any idea why? Using SAS 9.4 TS Level 1M3
WARNING: Apparent symbolic reference LT not resolved.
WARNING: Apparent symbolic reference GT not resolved.
WARNING: Apparent symbolic reference LT not resolved.
WARNING: Apparent symbolic reference GT not resolved.
NOTE: The internal source spool file has been truncated. Error logging with line and column
information might be incomplete until next step boundary.
YHQSRC/XZPWRIT failure
Could you share what code did you execute?
What SAS session are you using (UTF8, latin2, wlatin2, etc)?
Could you share more log?
Did you use the code from github:
filename packages "/path/for/packages"; /* setup temporary directory for packages in the WORK */
filename SPFinit url "https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas";
%include SPFinit; /* enable the framework */
%installPackage(SPFinit)
/* %include packages(SPFinit.sas); */
%installPackage(packageName) /* install the package */
%helpPackage(packageName) /* get help about the package */
%loadPackage(packageName) /* load the package content into the SAS session */
Maybe write me a private message, so we could discuss and figure it out.
All the best
Bart
Bart,
I tried using the code in the Getting_Started_with_SAS_Packages.pdf you posted:
filename packages "C:\Users\soj2\Documents\SAS_Packages";
%include packages(SPFinit.sas);
I'm not really sure about the SAS session. How do I find that?
Ok,
1) About SAS session, try to run:
%put &=sysencoding.;
2) Did you downloaded both files: SPFinit.sas and baseplus.zip into "C:\Users\soj2\Documents\SAS_Packages"?
All the best
Bart
Bart,
Yes, I downloaded SPFinit.sas and baseplus.zip into "C:\Users\soj2\Documents\SAS_Packages".
sysencoding=wlatin1
Dear SAS community,
I updated the `%rainCloudMacro()`.
New parameters were added and the doc. was updated. You can check it out here: https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#raincloudplot-macro
Thank you for the feedback I've got from you! [especially to Brian (@BTAinRVA)].
I hope you will find it useful. And as usual, any more feedback is more than welcome!
All the best
Bart
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.