Below is my code and my output . The blue marked part was repeated. How can I remove the repeated part. I only want to display one "Coronary Heart Disease" and one "Cerebral Vascular Disease" on the header.
data heart;
set sashelp.heart;
where DeathCause in ("Coronary Heart Disease",'Cerebral Vascular Disease') and AgeAtStart>60;
run;
proc sgpanel data=heart;
panelby deathcause BP_Status / rows=1 columns= 6 novarname;
vbar ageatdeath / group=sex groupdisplay=cluster ;
rowaxis refticks=(values);
keylegend / title='' noborder;
run;
Thanks
Remove BP_status from the panelby statement. Or change to rows=2 and columns=3 to get the deathcause in a separate panel.
The order of groupings on the panelby statement would depend on what you want to compare easily. With t
panelby deathcause BP_Status / rows=2 columns= 3 novarname; I would expect that the deathcause would be on a single row and the BP_status would align underneath which would show the BP_status within deathcause.
If I wanted to see if similar BP_status had different deathcause I might go with
panelby BP_Status deathcause/ rows=3 columns= 2 novarname;
The layout should support you main purpose of showing the graph at all.
Thanks for your response. I just took heart dataset as an example. Unfortunately, our shell only has one row.
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!
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.