10-02-2016 08:33 PM
I am a newbie, who is using proc univariate to create a histogram but I'm having issues. My problem is that all the observations are bunched up under one bin/bar. Can anyone please guide me what could be the issue? Thank you in advance for your help!
***Temporary setting default values for graphics attributes***;
goptions reset=global /*Cancels all global statements */
gunit=pct /*Specifies the default unit of measure to be Percent, which to be used with height specifications.*/
hsize= 10.625 in /*Sets horizontal heigh of graphic area */
vsize= 8.5 in /*Sets vertical heigh of graphic area */
htitle=4 /*Selects the default height (default percent) used for the first TITLE line.*/
htext=3 /*Specifies the default height of the text in the graphics output. */
vorigin=0 in /*Sets vertical origin of graph */
horigin= 0 in /*Sets horizonal origin of graph */
cback=white border /*Background color of graph is set to white */
ctext=black /*Text color is black*/
colors=(black blue green red yellow) /*Specifies the foreground colors used to produce your graphics output*/
ftext=swiss /*Default font for all text*/
lfactor=3; /*Line Thickness */
proc freq data =Project1.Org ;
proc univariate data=Project1.Org noprint;
/ endpoints = 0 to 39;
10-02-2016 10:14 PM
1) specify step width. data class; set sashelp.class end=last; output; if last then do;age=30;output;end; run; proc univariate data=class; var age; histogram age/ endpoints=(0 to 30 by 1) ; run; 2) Your data is discrete not continuous, it is not good for Histogram, but for VBAR chart. proc sgplot data=class; vbar age/ stat=percent; run;
10-03-2016 09:26 AM
10-02-2016 10:17 PM
data class; set sashelp.class end=last; output; if last then do;age=30;output;end; run; proc univariate data=class; var age; histogram age/ endpoints=(0 to 30 by 1) rtinclude ; run;
10-03-2016 12:42 AM
ENDPOINTS & MIDPOINTS must cover the full interval otherwise SAS ignores it. There will be a message in the log to that effect.
So, exclude your outliers with a WHERE statement.
Where variable< 10000;
Need further help from the community? Please ask a new question.