Previous Page | Next Page

The CHART Procedure

Example 1: Producing a Simple Frequency Count


Procedure features:

VBAR statement


This example produces a vertical bar chart that shows a frequency count for the values of the chart variable.


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
data shirts;
   input Size $ @@;
   datalines;
medium    large
large     large
large     medium
medium    small
small     medium
medium    large
small     medium
large     large
large     small
medium    medium
medium    medium
medium    large
small     small
;
 Note about code
proc chart data=shirts;
   vbar size;
 Note about code
   title 'Number of Each Shirt Size Sold';
run;

Output: Listing

 Note about figure
                         Number of Each Shirt Size Sold                        1

                Frequency

                11 +                   *****
                   |                   *****
                   |                   *****
                   |                   *****
                10 +                   *****
                   |                   *****
                   |                   *****
                   |                   *****
                 9 +       *****       *****
                   |       *****       *****
                   |       *****       *****
                   |       *****       *****
                 8 +       *****       *****
                   |       *****       *****
                   |       *****       *****
                   |       *****       *****
                 7 +       *****       *****
                   |       *****       *****
                   |       *****       *****
                   |       *****       *****
                 6 +       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                 5 +       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                 4 +       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                 3 +       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                 2 +       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                 1 +       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   |       *****       *****       *****
                   --------------------------------------------
                           large      medium       small

                                       Size

Previous Page | Next Page | Top of Page