Previous Page | Next Page

The GCHART Procedure

Example 6: Generating Error Bars in a Horizontal Bar Chart


Procedure features:

HBAR statement options:

CLM=

ERRORBAR=

FREQLABEL=

MEANLABEL=

NOFRAME

SUMVAR=

TYPE=

Other features:

GOPTIONS statement option:

BORDER

AXIS statement

Sample library member: GCHERRBR

[GCHERRBR-Generating error bars in a horizontal bar chart]

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
goptions reset=all border;
 Note about code
data fitness;
input age sex $ heart exer aero;
datalines;
28 M 86 2 36.6
41 M 76 3 26.7
30 M 78 2 33.8
29 M 54 3 44.8
48 F 66 2 28.9
36 F 66 2 33.2
;
 Note about code
title1 "Average Resting Heart Rate by Age";
footnote j=r "GCHERRBR";
 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
proc gchart data=fitness;
hbar age / type=mean
sumvar=heart
freqlabel="Number in Group"
meanlabel="Mean Heart Rate"
errorbar=bars
clm=95
midpoints=(30 40 50)
raxis=axis1
maxis=axis2
noframe;
run;
quit;

Previous Page | Next Page | Top of Page