The HPBIN Procedure

Example 4.4 Winsorized Binning

For Winsorized binning, PROC HPBIN provides bucket binning and basic Winsorized statistical information for the input data. The following statements include the WINSOR and WINSORRATE=0.05 options and generate tables for 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.4.1 and Output 4.4.2.

Output 4.4.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.50175743 0.00316436 500 5 501 5.01000000 8998
x2 5.03025502 0.03185024 500 5 501 5.01000000 8998



Output 4.4.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.50209276 0.00316434 500 5 501 5.01000000 8998
x2 5.03201037 0.03185006 500 5 501 5.01000000 8998