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.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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