Graphics Programming

Data visualization using SAS programming, including ODS Graphics and SAS/GRAPH. Charts, plots, maps, and more!
BookmarkSubscribeRSS Feed
simkinm2
Calcite | Level 5

I'd like to create histograms for about 50 continuous variables with bins based on the <25th percentile, 25th-50th percentile, 50th-75th percentile, and > 75th percentile. Is there a way to do this with proc univariate?

5 REPLIES 5
PaigeMiller
Diamond | Level 26

The pre-programmed histograms in SAS don't allow you to set bin limits at 25 percentile, 50 percentile, 75 percentile and so on. With some programming I think you could make that happen.

 

Of course, a box plot sounds exactly like what you are talking about, it shows 25 percentile, 50 percentile, 75 percentile and other statistics, and allows you to compare the "distributions" (as displayed by the boxplot) of 50 variables visually.

--
Paige Miller
simkinm2
Calcite | Level 5

That's what I thought...I started programming these IQRs for some frequency distributions along with the histograms and hoped there was an easier way!

 

Thanks!

 

 

simkinm2
Calcite | Level 5

Meant to say along with the box plots

ballardw
Super User

You might find this example helpful:  http://support.sas.com/kb/35/171.html

Go to the Results Tab to see the graph, the Full code has the Proc Template code and uses a standard SAS data set to display.

It has an extra element of a small fringe plot to provide a little more detail of distribution that the bare histogram provides.

Reeza
Super User

In a histogram the bins based on percentiles would produce a flat line, wouldn’t it? 

Perhaps you mean something different? 

 


@simkinm2 wrote:

I'd like to create histograms for about 50 continuous variables with bins based on the <25th percentile, 25th-50th percentile, 50th-75th percentile, and > 75th percentile. Is there a way to do this with proc univariate?


 

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1813 views
  • 4 likes
  • 4 in conversation