turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- Vertical box plot with two variables on x axis

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-17-2018 01:33 PM

Hello I need to make a vertical box plot to summarize outcome by gender AND disease.

I know how to make a vertical box plot with one of the two variables on the x axis but how would i incorporate the other one?

Here is my code for just one variable. Thanks for any help!

`proc sgplot data=combined;`

vbox Mean_T_S_Ratio /category=gender boxwidth=0.5; xaxis label="gender";
run;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to iressa131

04-17-2018 01:54 PM

A box plot, by definition, uses only one variable on the vertical axis. The CATEGORY= option allows only one variable.

So to directly answer your question: you cannot make a boxplot with two variables on the vertical axis.

Some other type of graph might be appropriate, such as HEATMAP, or just a plain old scatterplot.

--

Paige Miller

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PaigeMiller

04-17-2018 02:10 PM

Thank you!