Chapter Contents

Previous

Next
The GCHART Procedure

Example 6: Generating Error Bars in a Horizontal Bar Chart


Procedure features:
HBAR statement options:
CLM=
COUTLINE=
ERRORBAR=
FREQLABEL=
MEANLABEL=
NOFRAME
SUMVAR=
TYPE=
Other features:
AXIS statement
PATTERN statement
Data set: FITNESS
Sample library member: GR13N06

[IMAGE]

This example uses the FITNESS data set to chart the mean heart rate for each age group with error bars showing the confidence limits for the average. The response axis label describes the confidence limit for the error bars. To make the error bars easier to read, the program suppresses the frame that the procedure draws around the axis area. Descriptive column head labels in the table of statistics replace the statistic names that appear by default.
 Note about code
libname reflib 'SAS-data-library';
goptions reset=global gunit=pct border cback=white
         colors=(black blue green red) ftext=swiss
         ftitle=swissb htitle=5 htext=3.5;
 Note about code
title1 'Average Resting Heart Rate by Age';
footnote h=3 j=r 'GR13N06 ';
 Note about code
axis1 label=('Heart Rate' j=c
             'Error Bar Confidence Limits: 95%')
       minor=(number=1);
axis2 label=('Age' j=r 'Group');
 Note about code
pattern1 color=cyan;
 Note about code
proc gchart data=reflib.fitness;
   hbar age / type=mean
              sumvar=heart
              freqlabel='Number in Group'
              meanlabel='Mean  Heart Rate'
              errorbar=bars
              clm=95
              midpoints=(20 30 40 50)
              raxis=axis1
              maxis=axis2
              noframe
              coutline=black;
run;
quit;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.