SAS Graph with Error Bars

Example SAS Code
The following code produces the graph above -- which displays means as bars and includes 95% error bars. The data set used for this example is found here and the SAS code is here. Save the date file to the following location: C:\SASDATA\SOMEDATA.SAS7BDAT or change the code to point to the location where you have saved the data file.
Note:
- The Pattern option is used to make the bars gray
- The INSIDE=MEAN causes the mean values to be displayed within the bars
- The CLM=95 specifies the 95% CI
- The ERRORBAR=TOP causes the error bars to be displayed on the top of the bars
PATTERN1 COLOR=GRAYCC;
AXIS1 LABEL=(F="ARIAL/BOLD" "HOURS")
MINOR=NONE;
AXIS2 LABEL=(F="ARIAL/BOLD" "DEPARTMENT");
TITLE1 'Mean With Error Bars, Version 2';
TITLE2 '(With 95% Confidence Limits)';
PROC GCHART DATA='C:\SASDATA\SOMEDATA';
VBAR GP /
WIDTH=15
TYPE=MEAN
INSIDE=MEAN
ERRORBAR=TOP
CLM=95
SUMVAR=TIME1
RAXIS=AXIS1 MAXIS=AXIS2
COUTLINE=BLACK WOUTLINE=1;
RUN;
QUIT;
Error Bar SAS Graph Code
(right click link to open and save SAS code)


