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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.