BookmarkSubscribeRSS Feed
Quartz | Level 8


I would like to create a box plot for 4 continous variables, but that are not linked with any categorical variable. 
Actually, i'd like to plot the output of the proc univariate with the means and quantiles.

Here is an excerpt of what the Proc univariate gives me for one of my 4 variables : 

                                       Quantile      Estimate                                        
                                        100% Max       6.24719                                        
                                        99%            5.68653                                        
                                        95%            5.43895                                        
                                        90%            5.24901                                        
                                        75% Q3         4.82637                                        
                                        50% Median     4.32900                                        
                                        25% Q1         4.02401                                        
                                        10%            3.62096                                        
                                        5%             3.45388                                        
                                        1%             3.23710                                        
                                        0% Min         2.77457


Now, I would like to plot thoses pieces of information in the style of a boxplot, for my 4 variables. 


Also, I work on SAS 9.1... 


Any idea ? 


Thank you very much by advance for your help 🙂



Diamond | Level 26

I think PROC BOXPLOT works in 9.1

Paige Miller
Quartz | Level 8

I does, but i didn't find how to use it for only one continuous variable, without gaving so specify a categorical variable.



Diamond | Level 26

You could have PROC UNIVARIATE create a box plot by using the PLOTS option.

Paige Miller
Jade | Level 19

Hello @Mathis1,


For PROC BOXPLOT you can temporarily define a constant "dummy" variable and use that after the asterisk in the PLOT statement.



data _tmp / view=_tmp;
set have;
retain _c 'A0'x;

proc boxplot data=_tmp;
plot var1*_c / nohlabel;

The NOHLABEL option suppresses the label "_c" of the horizontal axis (but feel free to define a label using a LABEL statement in the PROC BOXPLOT step instead). The constant value of variable _c is used as the tick mark label. If you have a better idea than a non-missing blank value ('A0'x), use that.

Barite | Level 11

@Mathis1 Do you want 4 boxplots on 1 graph? Or 4 different box plots?



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
  • 5 replies
  • 4 in conversation