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
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:
What version of SAS?
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
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.
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
I have got your point. That is the one I am seeking.
I think I can try merge the two headers into one.
Best
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.