BookmarkSubscribeRSS Feed
sasjourney
Calcite | Level 5

Hi all,

I was trying to generate a forest plot using sgplot for subgroup analysis, but when doing that the subgroups are getting overlapped since there are 100+ subgroups. So, I was checking to see if there is there a way to span the forest plot to multiple pages with equal spacing on y-axis. Also, is there a way to control spacing between the subgroups on y-axis.

For example:

Male

Female

US

Non-US

Age <=65 Yrs

Age > 65 Yrs

etc

Thanks for your help

2 REPLIES 2
Jay54
Meteorite | Level 14

One way would be to add a BY variable (say "foo")  to your data, with the right number of subgroups per value of FOO.  FOO would have values 1,2,3 based on number of subgroups per page.  Then, use  BY=FOO statement with the SGPLOT procedure.  Or, use SGPANEL procedure with PANELBY=FOO.

sasjourney
Calcite | Level 5

Thanks Sanjay,

That is what I ended up doing to do multiple page graph, but still couldn't figure out how to control the spaces on y-axis. Is there any option to group a subgroup and leave a space between each subgroup? BTW i also generated the same graph using GTL and output looks excellent except the lack of TickValueList option in 9.3 for log scale. Thanks for the code provided in your blog.

Thanks

SAS INNOVATE 2024

Innovate_SAS_Blue.png

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. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1032 views
  • 3 likes
  • 2 in conversation