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
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.
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.