Data visualization with SAS programming

Panelby issue

Frequent Contributor
Posts: 94

Panelby issue

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;

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;





Super User
Posts: 13,046

Re: Panelby issue

Posted in reply to Niugg2010

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.

Frequent Contributor
Posts: 94

Re: Panelby issue

Thanks for your response. I just took heart dataset as an example. Unfortunately, our shell only has one row. 

Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation