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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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