Previous Page | Next Page

The COMPARE Procedure

Example 7: Creating an Output Data Set of Statistics (OUTSTATS=)


Procedure features:

PROC COMPARE statement options:

NOPRINT

OUTSTATS=

Data sets: PROCLIB.EMP95, PROCLIB.EMP96

This example creates an output data set that contains summary statistics for the numeric variables that are compared.


Program

 Note about code
libname proclib 'SAS-library';
 Note about code
options nodate pageno=1 linesize=80 pagesize=40;
 Note about code
proc sort data=proclib.emp95 out=emp95_byidnum;
   by idnum;
run;

proc sort data=proclib.emp96 out=emp96_byidnum;
   by idnum;
run;
 Note about code
proc compare base=emp95_byidnum compare=emp96_byidnum
             outstats=diffstat noprint;
   id idnum;
run;
 Note about code
proc print data=diffstat noobs;
   title 'The DIFFSTAT Data Set';
run;

Output: Listing

 Note about figure
                             The DIFFSTAT Data Set                             1

       _VAR_     _TYPE_        _BASE_      _COMP_      _DIF_    _PCTDIF_

       salary    N              10.00       10.00      10.00     10.0000
       salary    MEAN        52359.00    53089.00     730.00      1.2374
       salary    STD         24143.84    24631.01     996.72      1.6826
       salary    MAX         92100.00    92100.00    2400.00      4.3864
       salary    MIN         29025.00    29025.00       0.00      0.0000
       salary    STDERR       7634.95     7789.01     315.19      0.5321
       salary    T               6.86        6.82       2.32      2.3255
       salary    PROBT           0.00        0.00       0.05      0.0451
       salary    NDIF            4.00       40.00        .         .    
       salary    DIFMEANS        1.39        1.38     730.00       .    
       salary    R,RSQ           1.00        1.00        .         .    

Previous Page | Next Page | Top of Page