The HPREG Procedure

Classification Variables and the SPLIT Option

PROC HPREG supports the ability to split classification variables when doing model selection. You use the SPLIT option in the CLASS statement to specify that the columns of the design matrix that correspond to effects that contain a split classification variable can enter or leave a model independently of the other design columns of that effect. The following statements illustrate the use of SPLIT option:

data splitExample;
   length c2 $6;
   drop i;
   do i=1 to 1000;
     c1 = 1 + mod(i,6);
     if      i < 250 then c2 = 'low';
     else if i < 500 then c2 = 'medium';
     else                 c2 = 'high';
     x1 = ranuni(1);
     x2 = ranuni(1);
     y = x1+3*(c2 ='low')  + 10*(c1=3) +5*(c1=5) + rannor(1);
     output;
   end;
run;

proc hpreg data=splitExample;
   class c1(split) c2(order=data);
   model y = c1 c2 x1 x2/orderselect;
   selection method=forward;
run;

The "Class Levels" table shown in Figure 15.9 is produced by default whenever you specify a CLASS statement.

Figure 15.9: Class Levels

The HPREG Procedure

Class Level Information
Class Levels   Values
c1 6 * 1 2 3 4 5 6
c2 3   low medium high

* Associated Parameters Split




The SPLIT option has been specified for the classification variable c1. This permits the parameters associated with the effect c1 to enter or leave the model individually. The "Parameter Estimates" table in Figure 15.10 shows that for this example the parameters that correspond to only levels 3 and 5 of c1 are in the selected model. Finally, note that the ORDERSELECT option in the MODEL statement specifies that the parameters be displayed in the order in which they first entered the model.

Figure 15.10: Parameter Estimates

Parameter Estimates
Parameter DF Estimate Standard
Error
t Value Pr > |t|
Intercept 1 -0.308111 0.075387 -4.09 <.0001
c1_3 1 10.161702 0.087601 116.00 <.0001
c1_5 1 5.018407 0.087587 57.30 <.0001
c2 low 1 3.139941 0.078495 40.00 <.0001
c2 medium 1 0.221539 0.078364 2.83 0.0048
c2 high 0 0 . . .
x1 1 1.317420 0.109510 12.03 <.0001