Previous Page | Next Page

The QUANTREG Procedure

Analysis of Fish-Habitat Relationships

Quantile regression is used extensively in ecological studies (Cade and Noon 2003). Recently, Dunham, Cade, and Terrell (2002) applied quantile regression to analyze fish-habitat relationships for Lahontan cutthroat trout in 13 streams of the eastern Lahontan basin, which covers most of northern Nevada and parts of southern Oregon. The density of trout (number of trout per meter) was measured by sampling stream sites from 1993 to 1999. The width-to-depth ratio of the stream site was determined as a measure of stream habitat.

The goal of this study was to explore the relationship between the conditional quantiles of trout density and the width-to-depth ratio. The scatter plot of the data in Figure 72.1 indicates a nonlinear relationship, and so it is reasonable to fit regression models for the conditional quantiles of the log of density. Since regression quantiles are equivariant under any monotonic (linear or nonlinear) transformation (Koenker and Hallock 2001), the exponential transformation converts the conditional quantiles to the original density scale.

The data set trout, which follows, includes the average numbers of Lahontan cutthroat trout per meter of stream (Density), the logarithm of Density (LnDensity), and the width-to-depth ratios (WDRatio) for 71 samples.

      data trout;
         input Density WDRatio LnDensity @@;
         datalines;
      0.38732     8.6819    -0.94850    1.16956    10.5102     0.15662
      0.42025    10.7636    -0.86690    0.50059    12.7884    -0.69197
      0.74235    12.9266    -0.29793    0.40385    14.4884    -0.90672
      0.35245    15.2476    -1.04284    0.11499    16.6495    -2.16289
      0.18290    16.7188    -1.69881    0.06619    16.7859    -2.71523
      0.70330    19.0141    -0.35197    0.50845    19.0548    -0.67639
      0.06279    19.4959    -2.76796    0.14190    19.9446    -1.95265
      0.25725    20.7852    -1.35772    0.27240    21.0870    -1.30048
      0.27983    21.4564    -1.27357    0.12860    22.0917    -2.05105
      0.57867    22.1627    -0.54702    0.79667    22.4070    -0.22731
      0.03730    22.8553    -3.28880    0.27897    23.2003    -1.27666
      0.52587    23.6662    -0.64270    0.15075    23.6937    -1.89215
      0.10071    23.9129    -2.29548    0.16128    24.6643    -1.82461
      0.09254    24.9451    -2.38011    0.23937    24.9492    -1.42974
      0.06914    25.4138    -2.67158    0.17586    26.4412    -1.73805
      0.43725    26.8025    -0.82725    0.07812    28.0558    -2.54945
      0.06576    28.1194    -2.72174    0.26539    28.3045    -1.32654
      0.05159    28.3949    -2.96440    0.13779    29.4083    -1.98202
      0.55589    30.9569    -0.58719    0.29714    31.3376    -1.21354
      0.10857    31.7868    -2.22035    0.03897    31.9464    -3.24485
      0.53572    32.2492    -0.62414    0.26580    32.3725    -1.32500
      0.22114    33.1017    -1.50896    0.44212    33.3530    -0.81618
      0.07646    33.4036    -2.57099    0.47616    33.8079    -0.74200
      0.45934    34.5639    -0.77796    0.22627    34.7844    -1.48603
      0.19356    35.0004    -1.64215    0.29216    35.1803    -1.23045
      0.23243    35.2959    -1.45917    0.08155    35.3704    -2.50654
      0.19528    35.9115    -1.63332    0.22023    35.9382    -1.51308
      0.16411    36.4884    -1.80723    0.11296    36.7694    -2.18072
      0.49981    36.9893    -0.69353    0.40012    37.0055    -0.91599
      0.42912    37.7344    -0.84601    0.15294    38.0394    -1.87770
      0.31935    38.4524    -1.14147    0.30667    38.9076    -1.18198
      0.21722    40.0388    -1.52685    0.44777    42.2364    -0.80347
      0.41371    43.6465    -0.88259    0.32136    44.4753    -1.13520
      0.35369    44.7545    -1.03935    0.09101    44.9001    -2.39684
      0.11982    46.6135    -2.12175    0.16831    47.4509    -1.78197
      0.25125    54.6916    -1.38129
      ;

The following statements use the QUANTREG procedure to fit a simple linear model for the 90th percentile of LnDensity:

   proc quantreg data=trout alpha=0.01 ci=resampling;
      model LnDensity = WDRatio / quantile=0.9
                                  CovB CorrB
                                  seed=12345;
      test WDRatio / wald lr;
   run;

The MODEL statement specifies a simple linear regression model with LnDensity as the response variable and WDRatio as the covariate . The option QUANTILE=0.9 requests that the regression quantile function is to be estimated by solving

     

By default, the regression coefficients are estimated with the simplex algorithm, which is explained in the section Simplex Algorithm. The option ALPHA=0.01 requests 99 confidence limits for the regression parameters, and the option CI=RESAMPLING specifies that the intervals are to be computed with the MCMB resampling method of He and Hu (2002). By specifying the CI=RESAMPLING option, the QUANTREG procedure also computes standard errors, values, and -values of regression parameters with the MCMB resampling method. The SEED= option specifies a seed for the resampling method. The options COVB and CORRB request covariance and correlation matrices for the estimated regression coefficients, and the TEST statement requests tests for the hypothesis that the slope parameter (the coefficient of WDRatio) is zero.

Figure 72.3 displays model information and summary statistics for the variables in the model. The summary statistics include the median and the standardized median absolute deviation (MAD), which are robust measures of univariate location and scale, respectively. See Huber (1981, p. 108) for more details about the standardized MAD.

Figure 72.3 Model Fitting Information and Summary Statistics
The QUANTREG Procedure

Model Information
Data Set WORK.TROUT
Dependent Variable LnDensity
Number of Independent Variables 1
Number of Observations 71
Optimization Algorithm Simplex
Method for Confidence Limits Resampling

Summary Statistics
Variable Q1 Median Q3 Mean Standard
Deviation
MAD
WDRatio 22.0917 29.4083 35.9382 29.1752 9.9859 10.4970
LnDensity -2.0511 -1.3813 -0.8669 -1.4973 0.7682 0.8214

Figure 72.4 displays the parameter estimates, standard errors, 99 confidence limits, values, and -values computed by the resampling method.

Figure 72.4 Parameter Estimates
Parameter Estimates
Parameter DF Estimate Standard Error 99% Confidence Limits t Value Pr > |t|
Intercept 1 0.0576 0.2727 -0.6648 0.7801 0.21 0.8333
WDRatio 1 -0.0215 0.0073 -0.0408 -0.0022 -2.96 0.0042

The 90th percentile of trout density can be predicted from the width-to-depth ratio as follows:

     

This is the upper dashed curve plotted in Figure 72.1. The lower dashed curve for the median can be obtained by changing the option QUANTILE=0.9 to QUANTILE=0.5.

The covariance and correlation matrices for the estimated parameters are shown in Figure 72.5. The resampling method used for the confidence intervals is used to compute these matrices.

Figure 72.5 Covariance and Correlation
Estimated Covariance Matrix
  Intercept WDRatio
Intercept 0.074384 -.001934
WDRatio -.001934 0.000053

Estimated Correlation Matrix
  Intercept WDRatio
Intercept 1.00000 -0.97357
WDRatio -0.97357 1.00000

The tests requested with the TEST statement are shown in Figure 72.6. Both the Wald test and the likelihood ratio test indicate that the coefficient of width-to-depth ratio is significantly different from zero.

Figure 72.6 Tests of Significance
Tests
Test Test Statistic DF Chi-Square Pr > ChiSq
Wald 8.7467 1 8.75 0.0031
Likelihood Ratio 9.0529 1 9.05 0.0026

In many quantile regression problems it is useful to examine how the estimated regression parameters for each covariate change as a function of the quantile in the interval . The following statements use the QUANTREG procedure to request the estimated quantile processes for the slope and intercept parameters:

   ods graphics on;
    
   proc quantreg data=trout alpha=0.1 ci=resampling;
      model LnDensity = WDRatio / quantile=process seed=12345
                                  plot=quantplot;
   run;
    
   ods graphics off;

The QUANTILE=PROCESS option requests an estimate of the quantile process for each regression parameter. The options ALPHA=0.1 and CI=RESAMPLING specify that 90 confidence bands for the quantile processes are to be computed with the resampling method.

Figure 72.7 displays a portion of the objective function table for the entire quantile process. The objective function is evaluated at 77 values of in the interval . The table also provides predicted values of the conditional quantile function at the mean for WDRatio, which can be used to estimate the conditional density function.

Figure 72.7 Objective Function
Objective Function for Quantile
Process
Label Quantile Objective
Function
Predicted
at
Mean
t0 0.005634 0.7044 -3.2582
t1 0.020260 2.5331 -3.0331
t2 0.031348 3.7421 -2.9376
t3 0.046131 5.2538 -2.7013
. . . .
. . . .
. . . .
t73 0.945705 4.1433 -0.4361
t74 0.966377 2.5858 -0.4287
t75 0.976060 1.8512 -0.4082
t76 0.994366 0.4356 -0.4082

Figure 72.8 displays a portion of the table of the quantile processes for the estimated parameters and confidence limits.

Figure 72.8 Objective Function
Parameter Estimates for Quantile Process
Label Quantile Intercept WDRatio
. . . .
. . . .
. . . .
t57 0.765705 -0.42205 -0.01335
lower90 0.765705 -0.94184 -0.02696
upper90 0.765705 0.09773 0.00027
t58 0.786206 -0.32688 -0.01592
lower90 0.786206 -0.83355 -0.02984
upper90 0.786206 0.17978 -0.00200
. . . .
. . . .
. . . .

The PLOT=QUANTPLOT option in the MODEL statement, together with the ODS GRAPHICS statement, requests a plot of the estimated quantile processes. The left side of Figure 72.9 displays the process for the intercept, and the right side displays the process for the coefficient of WDRatio.

The process plot for WDRatio shows that the slope parameter changes from positive to negative as the quantile increases, and it changes sign with a sharp drop at the 40th percentile. The 90 confidence bands show that the relationship between LnDensity and WDRatio (expressed by the slope) is not significant below the 78th percentile. This situation can also be seen in Figure 72.8, which shows that 0 falls between the lower and upper confidence limits of the slope parameter for quantiles below 0.78. Since the confidence intervals for the extreme quantiles are not stable due to insufficient data, the confidence band is not displayed outside the interval (0.05, 0.95).

Figure 72.9 Quantile Processes for Intercept and Slope
Quantile Processes for Intercept and Slope

Previous Page | Next Page | Top of Page