Data visualization with SAS programming

How to create below figure via GTL?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 88
Accepted Solution

How to create below figure via GTL?

Please help me figure out how to create below figure via GTL, thanks.
GraphQ.png

Accepted Solutions
Solution
‎08-26-2016 12:10 PM
SAS Super FREQ
Posts: 925

Re: How to create below figure via GTL?

Unfortunately, we do not have support for multi-header layouts at this time. However, your age group variable fall into a natural cluster grouping scenario. Have you tried putting "agegroup" as the group variable and "drug description" on the lattice?

 

Thanks!
Dan

View solution in original post


All Replies
Super User
Super User
Posts: 7,720

Re: How to create below figure via GTL?

It looks like a multi-panel bargraph to me.  You will find examples on pretty much every graph over here including code:

http://blogs.sas.com/content/graphicallyspeaking/

 

For instance:

http://blogs.sas.com/content/graphicallyspeaking/?s=panel

Super User
Posts: 19,167

Re: How to create below figure via GTL?

What version of SAS?

SAS Super FREQ
Posts: 8,820

Re: How to create below figure via GTL?

Hi:
I'm not sure you need GTL, it looks like SGPANEL output to me. What code have you tried?
cynthia
SAS Super FREQ
Posts: 925

Re: How to create below figure via GTL?

If a may make a suggestion, try taking the variable you used for the panel row (agegroup ?) and make it the grouping variable for the bar chart. I think it would make your comparisons in the chart easier to read.

 

To accomplish this with PROC SGPANEL, you code will look something like this:

 

proc sgpanel data=outcome;

panelby sequence treatment / layout=lattice onpanel novarname;

vbar outcome / response=count group=agegroup groupdisplay=cluster; /* not sure of what stat you need */

run;

 

Hope this helps!

Dan

Frequent Contributor
Posts: 88

Re: How to create below figure via GTL?

Thanks for your code. But I can only get below with each cell contains two formulation results. I know this is due to we use the Lattice alyout. What I am seeking is is there possibility to add two levels in the header and with each row for one age group? Just like my sample figure in the first post.

 

Thanks.

SGPanel2.png

Solution
‎08-26-2016 12:10 PM
SAS Super FREQ
Posts: 925

Re: How to create below figure via GTL?

Unfortunately, we do not have support for multi-header layouts at this time. However, your age group variable fall into a natural cluster grouping scenario. Have you tried putting "agegroup" as the group variable and "drug description" on the lattice?

 

Thanks!
Dan

Frequent Contributor
Posts: 88

Re: How to create below figure via GTL?

I have got your point. That is the one I am seeking.

I think I can try merge the two headers into one.

 

Best

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 280 views
  • 0 likes
  • 5 in conversation