BookmarkSubscribeRSS Feed
yabwon
Meteorite | Level 14

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:

baseplus_RainCloudPlot_Ex0_9.png

 

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

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



13 REPLIES 13
yabwon
Meteorite | Level 14

I'm glad you like it. 🙂

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



Quentin
PROC Star

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.

Check out the Boston Area SAS Users Group (BASUG) video archives: https://www.basug.org/videos.
yabwon
Meteorite | Level 14

I did it with SGPLOT because I don't feel confident with GTL (though I would like to feel) 🙂

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



michal_1407
Fluorite | Level 6

Great job!

 

I will use it in my work in BAU project!

yabwon
Meteorite | Level 14

That's good news 🙂

 

B.

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



BTAinRVA
Quartz | Level 8

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

yabwon
Meteorite | Level 14

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

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



PaigeMiller
Diamond | Level 26

@yabwon 

 

I am looking forward to trying this on "real" data!

--
Paige Miller
BTAinRVA
Quartz | Level 8

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?

yabwon
Meteorite | Level 14

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

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



BTAinRVA
Quartz | Level 8

Bart,

Yes, I downloaded SPFinit.sas and baseplus.zip into "C:\Users\soj2\Documents\SAS_Packages".

 

sysencoding=wlatin1

 

yabwon
Meteorite | Level 14

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

 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 13 replies
  • 1235 views
  • 24 likes
  • 6 in conversation