Chapter Contents


SAS/ACCESS Interface to SYSTEM 2000 Data Management Software: Reference

Calculating Statistics

You can also use statistical procedures with SYSTEM 2000 data. The following sections show simple examples using the FREQ and MEANS procedures.

Using the FREQ Procedure

Suppose you want to find what percentages of your employees have specific degrees. The following example calculates the percentage of employees for each degree appearing in the EMPLOYEE database using the view descriptor VLIB.EMPEDUC:

    proc freq data=vlib.empeduc;
       tables degree;
       title2 'Data Described by VLIB.EMPEDUC';

Frequency Table for Item DEGREE Described by View Descriptor VLIB.EMPEDUC shows the one-way frequency table this example generates.

Frequency Table for Item DEGREE Described by View Descriptor VLIB.EMPEDUC
                       Data Described by VLIB.EMPEDUC                   1
                                          Cumulative  Cumulative
           DEGREE    Frequency   Percent   Frequency    Percent
           AA               5       7.9           5        7.9
           BA              12      19.0          17       27.0
           BS              23      36.5          40       63.5
           HIGH SC          6       9.5          46       73.0
           MA               3       4.8          49       77.8
           MBA              1       1.6          50       79.4
           MS               9      14.3          59       93.7
           PHD              4       6.3          63      100.0
                           Frequency Missing = 12

For more information on the FREQ procedure, see the SAS Procedures Guide.

Using the MEANS Procedure

In your further analysis of employee education, suppose you also want to develop some statistics on employees' skill types and their years of experience. The view descriptor VLIB.EMPSKIL accesses values from the EMPLOYEE database for skill type and years of experience.

The following example generates the mean and sum of the years of experience by skill type. Also included are the number of observations (N) and the number of missing values (NMISS).

    proc means data=vlib.empskil mean sum n nmiss
       by skilltyp;
       var years;
       title2 'Data Described by VLIB.EMPSKIL';

Note that the BY statement causes the interface view engine to generate a SYSTEM 2000 ordering-clause so that the data is sorted by skill type. Statistics on Skill Type and Years of Experience shows some of the information produced by this example.

Statistics on Skill Type and Years of Experience
                      Data Described by VLIB.EMPSKIL                      1
                   Analysis Variable : YEARS YEARS OF EXPERIENCE
--------------------------- SKILL TYPE=  -----------------------------------
                     N  Nmiss          Mean           Sum
                     0      6             .             .
--------------------------- SKILL TYPE=ACCOUNTING --------------------------
                     N  Nmiss          Mean           Sum
                     6      0             8            47
---------------------------- SKILL TYPE=ASSEMBLER --------------------------
                     N  Nmiss          Mean           Sum
                    14      0            10           141
--------------------------- SKILL TYPE=CARTOON ART -------------------------
                     N  Nmiss          Mean           Sum
                     1      0             1             1
----------------------------- SKILL TYPE=CHINESE ---------------------------
                     N  Nmiss          Mean           Sum
                     1      0             8             8
------------------------------ SKILL TYPE=COBOL ----------------------------
                     N  Nmiss          Mean           Sum
                    12      0             7            88

For more information on the MEANS procedure, see the SAS Procedures Guide.

Using the RANK Procedure

You can also use more advanced statistics procedures with SYSTEM 2000 data. The following example uses the RANK procedure with data described by the view descriptor VLIB.EMPBD to calculate the order of birthdays for a set of employees and to assign the variable name DATERNK to the new item created by the procedure. (The VLIB.EMPBD view descriptor includes a SYSTEM 2000 where-clause to select only the employees in the Marketing Department.)

   proc rank data=vlib.empbd out=mydata.rankexm;
      var birthday;
      ranks daternk;
   proc print data=mydata.rankexm;
      title2 'Order of Marketing Employee Birthdays';

Ranking of Employee Birthdays shows a portion of the result of this example.

Ranking of Employee Birthdays
                 Order of Marketing Employee Birthdays                     1
             1    AMEER         DAVID          10OCT51       14.0
             2    BROOKS        RUBEN R.       25FEB52       15.0
             3    BROWN         VIRGINA P.     24MAY46        9.0
             4    CHAN          TAI            04JUL46       10.0
             5    GARRETT       OLAN M.        23JAN35        2.0
             6    GIBSON        GEORGE J.      23APR46        8.0
             7    GOODSON       ALAN F.        21JUN50       13.0
             8    JUAREZ        ARMANDO        28MAY47       11.0
             9    LITTLEJOHN    FANNIE         17MAY54       17.0
            10    RICHARDSON    TRAVIS Z.      30NOV37        4.0
            11    RODRIGUEZ     ROMUALDO R     09FEB29        1.0
            12    SCHOLL        MADISON A.     19MAR45        7.0
            13    SHROPSHIRE    LELAND G.      04SEP49       12.0
            14    SMITH         JERRY LEE      13SEP42        5.5
            15    VAN HOTTEN    GWENDOLYN      13SEP42        5.5
            16    WAGGONNER     MERRILEE D     27APR36        3.0
            17    WILLIAMSON    JANICE L.      19MAY52       16.0

For more information on the RANK procedure and other advanced statistics procedures, see the SAS Procedures Guide.

Chapter Contents



Top of Page

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