The HPBIN Procedure

Example 4.3 Winsorized Binning

For Winsorized binning, PROC HPBIN provides both the bucket binning and the basic Winsorized statistical information for the input data. The following statements include both the WINSOR and WINSORRATE=0.05 options and generate tables for both Winsor and trimmed statistics.

    data ex12;
        length id 8;
        do id=1 to 10000;
            x1 = ranuni(101);
            x2 = 10*ranuni(201);
            x3 = 100*ranuni(301);
            output;
        end;
    run;
 ods output Winsor=Winsor;
 ods output Trim=Trim;
 ods listing close;
 proc hpbin data=ex12 NUMBIN=10 WINSOR WINSORRATE=0.05;
     input x1-x2;
 run;
 ods listing;

The preceding statements generate Output 4.3.1 and Output 4.3.2.

Output 4.3.1: PROC HPBIN Winsorized Statistics

The HPBIN Procedure

Winsorized Statistics
Variable Mean Std Error
Mean
N
Left Tail
Percent
Left Tail
N
Right Tail
Percent
Right Tail
DF
x1 0.50176 0.00316 500 5.00000 501 5.01000 8998
x2 5.03026 0.03185 500 5.00000 501 5.01000 8998


Output 4.3.2: PROC HPBIN Trimmed Statistics

Trimmed Statistics
Variable Mean Std Error
Mean
N
Left Tail
Percent
Left Tail
N
Right Tail
Percent
Right Tail
DF
x1 0.50209 0.00316 500 5.00000 501 5.01000 8998
x2 5.03201 0.03185 500 5.00000 501 5.01000 8998