STANDARD Procedure

Overview: STANDARD Procedure

What Does the STANDARD Procedure Do?

The STANDARD procedure standardizes variables in a SAS data set to a given mean and standard deviation, and it creates a new SAS data set containing the standardized values.

Standardizing Data

The following output shows a simple standardization where the output data set contains standardized student exam scores. The statements that produce the output follow:
proc standard data=score mean=75 std=5
              out=stndtest;
run;

proc print data=stndtest;
run;
Standardized Test Scores Using PROC STANDARD
                         The SAS System                        1

                  Obs    Student       Test1

                    1    Capalleti    80.5388
                    2    Dubose       64.3918
                    3    Engles       80.9143
                    4    Grant        68.8980
                    5    Krupski      75.2816
                    6    Lundsford    79.7877
                    7    McBane       73.4041
                    8    Mullen       78.6612
                    9    Nguyen       74.9061
                   10    Patel        71.9020
                   11    Si           73.4041
                   12    Tanaka       77.9102
The following output shows a more complex example that uses BY-group processing. PROC STANDARD computes Z scores separately for two BY groups by standardizing life-expectancy data to a mean of 0 and a standard deviation of 1. The data are 1950 and 1993 life expectancies at birth for 16 countries. The birth rates for each country, classified as stable or rapid, form the two BY groups. The statements that produce the analysis also do the following:
  • print statistics for each variable to standardize
  • replace missing values with the given mean
  • calculate standardized values using a given mean and standard deviation
  • print the data set with the standardized values
For an explanation of the program that produces this output, see Standardizing BY Groups and Replacing Missing Values.
Z Scores for Each BY Group Using PROC STANDARD
                Life Expectancies by Birth Rate                2

-------------------- PopulationRate=Stable ---------------------

                     The STANDARD Procedure

                                   Standard
     Name              Mean       Deviation               N
     Label

     Life50       67.400000        1.854724               5
     1950 life expectancy
     Life93       74.500000        4.888763               6
     1993 life expectancy


--------------------- PopulationRate=Rapid ---------------------

                                   Standard
     Name              Mean       Deviation               N
     Label

     Life50       42.000000        5.033223               8
     1950 life expectancy
     Life93       59.100000        8.225300              10
     1993 life expectancy
            Standardized Life Expectancies at Birth            3
                   by a Country's Birth Rate

      Population
         Rate       Country            Life50      Life93

        Stable      France            -0.21567     0.51138
        Stable      Germany            0.32350     0.10228
        Stable      Japan             -1.83316     0.92048
        Stable      Russia             0.00000    -1.94323
        Stable      United Kingdom     0.86266     0.30683
        Stable      United States      0.86266     0.10228
        Rapid       Bangladesh         0.00000    -0.74161
        Rapid       Brazil             1.78812     0.96045
        Rapid       China             -0.19868     1.32518
        Rapid       Egypt              0.00000     0.10942
        Rapid       Ethiopia          -1.78812    -1.59265
        Rapid       India             -0.59604    -0.01216
        Rapid       Indonesia         -0.79472    -0.01216
        Rapid       Mozambique         0.00000    -1.47107
        Rapid       Philippines        1.19208     0.59572
        Rapid       Turkey             0.39736     0.83888