Chapter Contents

Previous

Next
The UNIVARIATE Procedure

Example 10: Creating a Two-Way Comparative Histogram


Procedure features:
PROC UNIVARIATE statement options:
NOPRINT
CLASS statement options:
ORDER=
HISTOGRAM statement options:
CFILL=
INTERTILE=
MIDPOINTS=
NCOLS=
NROWS=
VAXIS=
VAXISLABEL=
VSCALE=
INSET statement options:
FONT=
HEIGHT=
NOFRAME
POSITION=
statistical-keyword
VAR statement
Other features:
FORMAT statement
FORMAT procedure
GOPTIONS statement
Data set: METROPOP


Program
 Note about code
goptions htitle=4 htext=3 ftext=swiss ftitle=swiss;
 Note about code
proc format;
   value Regnfmt 1='Northeast'
                 2='South'
                 3='Midwest'
                 4='West';
run;
 Note about code
proc univariate data=metropop noprint;
    var populationcount;
 Note about code
   class region decade(order=freq);
 
 Note about code
    histogram /nrows=4 ncols=2 intertile=1 cfill=cyan vscale=count 
               vaxis=0 4 8 12 vaxislabel='No. of States' 
               midpoints=0 to 30 by 5;
 Note about code
inset sum='Total Population:' (4.1) / noframe position=ne
                                      height=2 font=swissxb;
 Note about code
   format region regnfmt.;
   title 'United States Census of Population and Housing';
run;


Output

Two-way Comparative Histogram

[IMAGE]


Chapter Contents

Previous

Next

Top of Page

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