BookmarkSubscribeRSS Feed
yabwon
Onyx | Level 15

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
Onyx | Level 15

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
Super User

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.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
yabwon
Onyx | Level 15

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
Onyx | Level 15

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
Onyx | Level 15

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
Onyx | Level 15

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
Onyx | Level 15

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.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 13 replies
  • 2223 views
  • 24 likes
  • 6 in conversation