BookmarkSubscribeRSS Feed
Niugg2010
Obsidian | Level 7

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;

Capture.JPG

 

Thanks

 

2 REPLIES 2
ballardw
Super User

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.

Niugg2010
Obsidian | Level 7

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 763 views
  • 0 likes
  • 2 in conversation