BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Ihsan-Mahdi
Quartz | Level 8

Hello,

I would like to create boxplots for 2 variables (distance and time) compared between two types of transport (air and ground).

All variables are numeric with the transport variable having 2 values (1 for air & 0 for ground).

Is there a way to produce such boxplots in one graph?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

As ballardw said post an example picture would better illustrate your question.

 

data have;
set sashelp.class;
label='Weight';value=weight;output;
label='Height';value=height;output;
keep sex label value;
run;
proc sgpanel data=have;
panelby sex label/layout=lattice novarname uniscale=column spacing=0;
vbox value;
run;

Ksharp_0-1724895960041.png

 

View solution in original post

3 REPLIES 3
ballardw
Super User

Short answer: Yes it is possible.

 

Longer, provide some example data in the form of a working data step as data structures often matter when attempting to plot values and some concrete example data we can write code and see how close we get to what you want.

Ksharp
Super User

As ballardw said post an example picture would better illustrate your question.

 

data have;
set sashelp.class;
label='Weight';value=weight;output;
label='Height';value=height;output;
keep sex label value;
run;
proc sgpanel data=have;
panelby sex label/layout=lattice novarname uniscale=column spacing=0;
vbox value;
run;

Ksharp_0-1724895960041.png

 

Ihsan-Mahdi
Quartz | Level 8

This code actually worked beautifully! Thank you 🙂

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

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