The HPQUANTSELECT Procedure

Macro Variables That Contain Selected Effects

PROC HPQUANTSELECT saves the list of selected effects in a macro variable for each selected model so that you can use other SAS procedures to perform postselection analyses. This list does not explicitly include the intercept so that you can use it in the MODEL statement of other SAS/STAT regression procedures.

When multiple quantile levels or BY processing are used, one macro variable, indexed by the quantile level order and the BY group number (as shown in Table 13.7), is created for each quantile level and BY group combination.

Table 13.7: Macro Variables Created for Subsequent Processing

Macro Variable

Description

Single Quantile Level and No BY Processing

_HPQRSIND

Selected model

Multiple Quantile Levels and No BY Processing

_HPQRSINDT1

Selected model for the first quantile level

_HPQRSINDT2

Selected model for the second quantile level

 

Single Quantile Level and BY Processing

_HPQRSIND1

Selected model for BY group 1

_HPQRSIND2

Selected model for BY group 2

 

Multiple Quantile Levels and BY Processing

_HPQRSIND1T1

Selected model for the first quantile level and BY group 1

_HPQRSIND1T2

Selected model for the second quantile level and BY group 1

 

_HPQRSIND2T1

Selected model for the first quantile level and BY group 2

_HPQRSIND2T2

Selected model for the second quantile level and BY group 2

 


The macro variables _HPQRSIND, _HPQRSINDT1, _HPQRSIND1, and _HPQRSIND1T1 are all synonyms.

The following statements generate a simulation data set, use PROC HPQUANTSELECT to select a median regression model, and print the macro variables for the selected model:

%let seed=321;
%let p=20;
%let n=3000;

data analysisData;
   array x{&p} x1-x&p;
   do i=1 to &n;
      do j=1 to &p;
         x{j} = ranuni(&seed);
      end;
      e  = ranuni(&seed);
      y  = x1 + x2 + x3 + e;
      output;
   end;
run;
proc hpquantselect data=analysisData;
   model y = x1-x&p;
   selection method=forward;
run;

%put _HPQRSIND    = &_hpqrsind;
%put _HPQRSIND1   = &_hpqrsind1;
%put _HPQRSIND1T1 = &_hpqrsind1t1;

The following statements use PROC HPREG to fit a linear regression model on the effects that are selected by the HPQUANTSELECT procedure:

proc hpreg data=analysisData;
   model y = &_hpqrsind;
run;