Hi,
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!
Regards
Saulat
========
Code:
***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 */
***Check***;
proc freq data =Project1.Org ;
tables promtime;
run;
proc univariate data=Project1.Org noprint;
histogram promtime
/ endpoints = 0 to 39;
run;
What does your log say?
Exclude your outlier with a WHERE statement instead.
What does your log say?
Exclude your outlier with a WHERE statement instead.
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;
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;
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;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.