Sample 24884: Annotate +/- one std of the mean - Example 2
/* Use the Annotate Facility to draw one std of */
/* the mean on a vbar chart. PROC MEANS is used to */
/* get the necessary statistics to be used by the */
/* annotate data step. */
goptions reset=all border;
data a;
input mid_var $ resp_var;
datalines;
AAA 5
AAA 4
AAA 7
BBB 7
BBB 6
BBB 9
CCC 4
CCC 3
CCC 6
DDD 5
DDD 4
DDD 7
;
proc means mean std data=a noprint;
by mid_var;
output out=b mean=mean std=std;
run;
data anno;
length color function $8;
retain xsys ysys '2' hsys '4' when 'a' color 'red' size 5;
set b;
/* Draw the std bar. The value for SIZE may have to be adjusted. */
function='move'; midpoint=mid_var; y=mean-std; output;
function='draw'; midpoint=mid_var; y=mean+std; output;
run;
pattern1 v=empty c=blue;
axis1 order=(0 to 10 by 5);
title1 ' One Std of Mean';
proc gchart data=a;
vbar mid_var / anno=anno raxis=axis1 type=mean sumvar=resp_var;
run;
quit;

Use the Annotate Facility to draw one std of the mean on a vbar chart. PROC means is used to get the necessary statistics to be used by the annotate data step.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GCHART Query and Reporting ==> Creating Reports ==> Graphical ==> Graph Elements ==> Statistical Graph Enhancements
|
| Date Modified: | 2005-08-24 16:06:28 |
| Date Created: | 2004-11-11 11:07:54 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | n/a | n/a |