BookmarkSubscribeRSS Feed
tal83
Calcite | Level 5
Hi,
1) I'm looking for a procedure where I can make Histograms that aren't evenly spaced (say 0-100,100-500,500-10,0,1000-3500)

2) In proc univariate histogram statment - can I add graphic options- such as the graph's color etc.? Can I save it to a GIF file?

Thanks!
7 REPLIES 7
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest starting here with a Google advanced search argument on the SAS.COM site.

histograms site:sas.com


Consider using SAS ODS for generating an image file such as a GIF.

The SAS support http://support.sas.com/ website has much to offer with SAS-hosted documentation, code samples, and supplemental topic-related reference papers.

Scott Barry
SBBWorks, Inc.
GraphGuy
Meteorite | Level 14
The easiest way I can think of to control the spacing (aka "bucketing" or "binning") in a histogram, is to create a user-defined format. The following example creates some fake/random data to demonstrate gchart's automatic binning (with levels=4), and then using a user-defined format (which I call 'myfmt') to make the bins exactly the way you want them ...

data foo;
do i = 1 to 1000;
value = 500 + 300*rannor(1);
output;
end;
run;

title "Using default gchart ranges";
proc gchart data=foo;
vbar value / type=freq levels=4;
run;


proc format;
value myfmt
low-<100 = 'less than 100'
100-500 = '100-500'
500-1000 = '500-1000'
1000<-high = 'over 1000'
;
run;

title "Controlling ranges with user-defined format";
proc gchart data=foo;
format value myfmt.;
vbar value / type=freq discrete;
run; Message was edited by: Robert Allison @ SAS
GraphGuy
Meteorite | Level 14
fixed it! Message was edited by: Robert Allison @ SAS
GraphGuy
Meteorite | Level 14
fixed it! Message was edited by: Robert Allison @ SAS
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Bookmark this page:

http://support.sas.com/forums/thread.jspa?messageID=27609

Scott Barry
SBBWorks, Inc.
GraphGuy
Meteorite | Level 14
Thanks for the tip, sbb!

I had to use the special character for the LT !
tal83
Calcite | Level 5
Thanks everybody!

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
  • 7 replies
  • 834 views
  • 0 likes
  • 3 in conversation