2 weeks ago - last edited 2 weeks ago by Reeza
Hi I'm trying to produce a histogram within SAS for education.
I tried using proc sgplot but was unable to make the intervals at the edges not the centre.
So I tried using proc univariate but was unable to label my axis.
Is it possible to do both?
proc univariate data=SASUSER.DATA1;
histogram sales2015 / endpoints=(0 to 16000 by 2000);
proc sgplot data=SASUSER.DATA1;
histogram sales2015 / nbins=7 binstart=1000 binwidth=2000 SHOWBINS ;
xaxis label="Sales in 2015";
2 weeks ago
Note: I've moved your post to the Graphs forum as it relates more to graphing than SAS Studio and I have changed your subject line to be more descriptive. You can undo any of these changes if you feel they are not appropriate.
2 weeks ago
Yes. You can control the location of the ticks and whether the labels occur at the end of the bins or in the middle of a bin. Follow the instructions and examples at "Choosing bins for histograms in SAS."
The same examp[le shows how to display titles In PROC UNIVARIATE by using the ODSTITLE= and ODSTITLE2= options.
You can refer to the contents of the TITLE and TITLE2 global statements, our you can specify a string:
histogram X / odstitle="Main title" odstitle2="minor title";