(View the complete code for this example.)
This example is based on Simulation Study. This simulation study shows how you can use the forward selection method to select quantile regression models for single quantile levels. The following statements simulate a data set from a naive instrumental model (Chernozhukov and Hansen 2008):
%let seed=321;
%let p=20;
%let n=3000;
data analysisData;
array x{&p} x1-x&p;
do i=1 to &n;
U = ranuni(&seed);
x1 = ranuni(&seed);
x2 = ranexp(&seed);
x3 = abs(rannor(&seed));
y = x1*(U-0.1) + x2*(U*U-0.25) + x3*(exp(U)-exp(0.9));
do j=4 to &p;
x{j} = ranuni(&seed);
end;
output;
end;
run;
Variable U in the data set indicates the true quantile level of the response y conditional on .
Let denote the underlying quantile regression model, where
. Then, the true parameter functions are
It is easy to see that, at , only
and
are nonzero parameters. Therefore, an effective effect-selection method should select
x2 and x3 and drop all the other effects in this data set at . By the same rationale,
x1 and x3 should be selected at with
and
, and
x1 and x2 should be selected at with
and
.
The following statements use PROC HPQUANTSELECT with the forward selection method. The STB option and the CLB option in the MODEL statement request the standardized parameter estimates and the confidence limits of parameter estimates, respectively.
proc hpquantselect data=analysisData;
model y= x1-x&p / quantile=0.1 0.5 0.9 stb clb;
selection method=forward;
output out=out p=pred;
run;
Output 66.1.1 shows that, by default, the CHOOSE= and STOP= options are both set to SBC.
Output 66.1.1: Model Information
| Selection Information | |
|---|---|
| Selection Method | Forward |
| Select Criterion | SBC |
| Stop Criterion | SBC |
| Effect Hierarchy Enforced | None |
| Stop Horizon | 3 |
Output 66.1.2, Output 66.1.3, and Output 66.1.4 display the selected effects and the parameter estimates for ,
, and
, respectively. You can see that the forward selection method correctly selects active effects for all three quantile levels.
Output 66.1.2: Parameter Estimates at
| Selected Effects: | Intercept x2 x3 |
|---|
| Parameter Estimates | ||||||||
|---|---|---|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standardized Estimate |
Standard Error |
95% Confidence Limits | t Value | Pr > |t| | |
| Intercept | 1 | 0.01179 | 0 | 0.01192 | -0.01158 | 0.03516 | 0.99 | 0.3225 |
| x2 | 1 | -0.22871 | -0.21829 | 0.00946 | -0.24725 | -0.21017 | -24.19 | <.0001 |
| x3 | 1 | -1.37991 | -0.78452 | 0.01556 | -1.41042 | -1.34939 | -88.67 | <.0001 |
Output 66.1.3: Parameter Estimates at
| Selected Effects: | Intercept x1 x3 |
|---|
| Parameter Estimates | ||||||||
|---|---|---|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standardized Estimate |
Standard Error |
95% Confidence Limits | t Value | Pr > |t| | |
| Intercept | 1 | 0.01178 | 0 | 0.03418 | -0.05524 | 0.07879 | 0.34 | 0.7304 |
| x1 | 1 | 0.42584 | 0.11879 | 0.06237 | 0.30355 | 0.54814 | 6.83 | <.0001 |
| x3 | 1 | -0.86332 | -0.49082 | 0.04765 | -0.95674 | -0.76989 | -18.12 | <.0001 |
Output 66.1.4: Parameter Estimates at
| Selected Effects: | Intercept x1 x2 |
|---|
| Parameter Estimates | ||||||||
|---|---|---|---|---|---|---|---|---|
| Parameter | DF | Estimate | Standardized Estimate |
Standard Error |
95% Confidence Limits | t Value | Pr > |t| | |
| Intercept | 1 | -0.00774 | 0 | 0.03292 | -0.07228 | 0.05680 | -0.24 | 0.8142 |
| x1 | 1 | 0.78294 | 0.21841 | 0.05134 | 0.68228 | 0.88360 | 15.25 | <.0001 |
| x2 | 1 | 0.57644 | 0.55018 | 0.03422 | 0.50935 | 0.64354 | 16.85 | <.0001 |