Dear SAS Community,
I would greatly appreciate it if you could let me know how to include percent of frequency inside all levels of the Variable Peel Color in this graph. For some levels the % is included in the bars, but not for all levels.
This is the code I am using:
ods powerpoint file='Storage PeelColor BL516 Harvest.pptx'image_dpi=300;
title "Storage PeelColor: BL516 vs Hass by Harvest month";
proc sgpanel data=one pctlevel=group;
where Harvest in(1,2,3,4,5,6,8) and Variety in('BL516','Hass');
panelby Harvest / columns=7 onepanel;
vbar Variety / group=PeelColor grouporder=ascending stat=percent
groupdisplay=stack seglabel;
run;
ods powerpoint close;
Thank you very much
Thank you so much for your quick reply, it was very helpful.
Is there a way remove them completely? If I don't include that statement I still get percentages in some bars but not others.
Thank you very much
You can try to switch VBAR into VBARPARM:
proc sort data=sashelp.heart out=have;
by smoking_status sex;
run;
proc freq data=have noprint;
by smoking_status sex;
table bp_status/out=have2 ;
run;
data have2;
set have2;
percent2=percent/100;
format percent2 percent8.2;
run;
proc sgpanel data=have2;
panelby smoking_status / rows=1 onepanel novarname;
vbarparm category=sex response=percent2/ group=bp_status grouporder=ascending
groupdisplay=stack seglabel seglabelfitpolicy=none;
run;
Thank you for your response Ksharp!
Nevermind, I was only getting some percentages because I was not including the seglabel option.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.