The QUANTREG Procedure

Example 97.5 Quantile Polynomial Regression for Salary Data

(View the complete code for this example.)

This example uses the data set from a university union survey of salaries of professors in 1991. The survey covered departments in US colleges and universities that list programs in statistics. The goal of this example is to examine the relationship between faculty salaries and years of service.

The data include salaries and years of service for 459 professors. The scatter plot in Output 97.5.1 shows that the relationship is not linear and that a quadratic or cubic regression curve is appropriate. Output 97.5.1 shows a cubic curve.

The curve in Output 97.5.1 does not adequately describe the conditional salary distributions and how they change with length of service. Output 97.5.2 shows the 25th, 50th, and 75th percentiles for each number of years, which gives a better picture of the conditional distributions.

data salary;
   input Salaries Years @@;
   label Salaries='Salaries (1000s of dollars)';
   datalines;
54.94   2  58.24   2  58.11   2  52.23   2  52.98    2  57.62    2
44.48   2  57.22   2  54.24   2  54.79   2  56.42    2  61.90    2
63.90   2  64.10   2  47.77   2  54.86   2  49.31    2  53.37    2
51.69   2  53.66   2  58.77   2  56.77   2  53.06    2  54.86    2
50.96   2  56.46   2  51.67   2  49.37   2  56.86    2  49.85    2

   ... more lines ...   

85.72  25  64.87  25  51.76  25  51.11  25  51.31   25  78.28   25
57.91  25  86.78  25  58.27  25  56.56  25  76.33   25  61.83   25
69.13  25  63.15  25  66.13  25
;

Output 97.5.1: Salary and Years as Professor: Cubic Fit

Salary and Years as Professor: Cubic Fit


Output 97.5.2: Salary and Years as Professor: Sample Quantiles

Salary and Years as Professor: Sample Quantiles


These descriptive percentiles do not clearly show trends with length of service. The following statements use polynomial quantile regression to obtain a smooth version.

ods graphics on;

proc quantreg data=salary ci=sparsity;
   model salaries = years years*years years*years*years
                     /quantile=0.25 0.5 0.75
                     plot=fitplot(showlimits);

   test  years/QINTERACT;

run;

The results are shown in Output 97.5.3 and Output 97.5.5. Output 97.5.3 displays the regression coefficients for the three quantiles, from which you can see a difference among the estimated parameters of the variable years across the three quantiles. To test whether the difference is significant, you can specify the option QINTERACT in the TEST statement. Output 97.5.4 indicates that the difference is not significant (the p-value is greater than 0.05).

Output 97.5.3: Regression Coefficients

The QUANTREG Procedure
Quantile Level = 0.25

Parameter Estimates
ParameterDFEstimateStandard
Error
95% Confidence Limitst ValuePr > |t|
Intercept148.25091.348445.601150.900735.78<.0001
Years12.22340.54551.15143.29534.08<.0001
Years*Years1-0.12920.0500-0.2275-0.0308-2.580.0101
Years*Years*Years10.00240.0013-0.00010.00491.860.0634

Parameter Estimates
ParameterDFEstimateStandard
Error
95% Confidence Limitst ValuePr > |t|
Intercept150.25121.281247.733452.769039.22<.0001
Years12.71730.59471.54853.88604.57<.0001
Years*Years1-0.16320.0632-0.2873-0.0390-2.580.0101
Years*Years*Years10.00340.0018-0.00020.00701.850.0647

Parameter Estimates
ParameterDFEstimateStandard
Error
95% Confidence Limitst ValuePr > |t|
Intercept151.02981.588647.907854.151732.12<.0001
Years13.65130.75942.15905.14364.81<.0001
Years*Years1-0.23900.0764-0.3892-0.0888-3.130.0019
Years*Years*Years10.00550.00210.00130.00962.600.0098


Output 97.5.4: Tests for Heteroscedasticity

Test Results Equal Coefficients
Across Quantiles
Chi-
Square
DFPr > ChiSq
3.402620.1825


The three fitted quantile curves and their 95% confidence limits in the Output 97.5.5 clearly show that salary dispersion increases gradually with length of service. After 15 years, a salary more than $70,000 is relatively high, whereas a salary less than $60,000 is relatively low. Percentile curves of this type are useful in medical science as reference curves (Yu, Lu, and Stander 2003).

Output 97.5.5: Salary and Years as Professor: Regression Quantiles

Salary and Years as Professor: Regression Quantiles