BookmarkSubscribeRSS Feed
t75wez1
Pyrite | Level 9

Thank you so much for your insight.

SupermanJP
Obsidian | Level 7
 version 1.3 is available. I am revising document but program can be use.

https://github.com/SASPAC/sasplotter

please check the md files.

I added "note" parameter . this parameter insert the text statement into the graph template and display title or footnote.
t75wez1
Pyrite | Level 9

Hi Superman JP,

I saw "note=," parameter in version 1.3 but don't see your updated SAS Sankey macro code.

Looking forward to seeing how to use it exactly in Sankey document.

Thanks,

 

yabwon
Onyx | Level 15

Here is an instruction how to get version 1.3 in a form of a SAS package:

https://github.com/SASPAC/sasplotter/blob/main/sasplotter.md#install

 

Here is a snippet how to add footnote and title:

*--------------------------------------------------------;
*sankey example;
*--------------------------------------------------------;

proc format;
value domainf
1="day0"
2="day30"
3="day60"
4="day120";

value nodef
0="Drug A"
1="Drug B"
2="Drug C"
3="Drug D"
4="Drug E"
;
run;


data raw;
usubjid+1;
input day0 day30 day60 day120;
format day0 day30 day60 day120 nodef.;
cards;
0 2 3 4
0 2 3 4
0 2 3 4
2 1 2 4
2 1 2 4
2 1 2 4
2 1 2 4
2 1 2 4
2 1 4 3
4 3 2 1
4 3 2 1
4 3 2 1
4 3 2 1
;
run;
*--------------------------------------------------------;
*basic sankey;
*--------------------------------------------------------;
ods graphics / height=15cm width=20cm imagefmt=png imagename="sankey_basic" noborder;
title "Bacic Sankey";
ods html;
%sankey(
    data=raw,
    domain=day0 day30 day60 day120,
    domainfmt=domainf,
	note=%nrstr(entrytitle 'your title here';
			    entryfootnote halign=left 'your footnote here';
				entryfootnote halign=left 'your footnote here 2';)
	);
_______________
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



SupermanJP
Obsidian | Level 7
Thanks bart.
t75wez1
Pyrite | Level 9

We can even add more features for titles and footnotes with color and fond size.

Thanks,

 
%sankey(
    data=raw,
    domain=day0 day30 day60 day120,
    domainfmt=domainf,
note=%nrstr(entrytitle 'your title here' / TEXTATTRS=(Color=purple Size=10 Style=normal Weight=Bold);
    entryfootnote halign=left 'your footnote here' / TEXTATTRS=(Color=purple Size=5 Style=normal Weight=Bold);
entryfootnote halign=left 'your footnote here 2' / TEXTATTRS=(Color=purple Size=5 Style=normal Weight=Bold);)
);
t75wez1
Pyrite | Level 9

Thanks to the ineffable Sanket chart I can apply to my project.

 

One more question here is how to get a weighted result if each observation is assigned a weighting value.

Thanks,

SupermanJP
Obsidian | Level 7
SAS Plotter can't handle the "weight".

Sankey program of SAS Plotter is considered for each patient treatment history data and not summarized data.

if there are enough request, I will update package.
t75wez1
Pyrite | Level 9

Thanks a lot for your insight.

 

I just curious if weight statement can be used in "proc freq" procedure of your macro code.

 

Happy data visualizing!

 

Cheers,

SupermanJP
Obsidian | Level 7
as you pointed out, I can add weight statement in proc freq of Sankey macros.
but I need to correct the calculation of proportion and endfollowup parameter. i think.

and according to above idea, I only can apply same weight value into all domains of each observation.

please teach me another example of Sankey diagram if you can.
t75wez1
Pyrite | Level 9

I only assume if we don't have any missing values for each observation.

 

Thanks,

t75wez1
Pyrite | Level 9

You're correct.

From my survey data, I only create one weight value for each observation when any respondent gives his/her answers for Day 1 and Day 30 and Day 60.

 

Thanks,

SAS Innovate 2025: Register Now

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 27 replies
  • 2699 views
  • 15 likes
  • 4 in conversation