stattutorials.com

Statistics Tutorials
for SAS, SPSS, WINKS, Excel


WINKS SDA

Statistical Software
Affordable. Reliable. Relevant.


www.texasoft.com
 


 

 

SAS Tutorial Menu

Main Tutorial Menu

Numbers

SAS Graph with Error Bars

SAS Graph 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:

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)