BookmarkSubscribeRSS Feed
selena_12234
Calcite | Level 5

Hello,

 

I used the following code to create Sankey bar charts to track sleep scores for people across multiple visits. How do I adjust the height of the bars so that each bar height is proportionate to the number of people who attended each visit?  Thanks

 

%sankeybarchart
(data=Sankey
,subject=subject
,yvar=sleep_scores
,xvar=visit
,yvarord=%str(0, 1, 2, 3, 4)
,xvarord=%str(0,1,2,3,4)
,barwidth=0.45
,xfmt=xfmt.
,legendtitle=%str(Sleep Scores)
);

1 REPLY 1
PhilC
Rhodochrosite | Level 12

No idea.  but I want to use this macro.  I didn't see it when it came out.  Thanks for introducing it to me.

 

There's got to be answers for you on the Github page.  IDK any but I'll put the link here just to be a good forum participant: 

GitHub - RhoInc/sas-sankeybarchart: A set of SAS macros for creating longitudinal bar charts with Sa...

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 797 views
  • 1 like
  • 2 in conversation