Supplement 1: S-Plus code for implementing quantile regressions.
Ecological Archives E080-001-S1.
Brian S. Cade, U. S. Geological Survey, January 1999.
brian_cade@usgs.gov
1. rq1.ssc is the S-Plus 4.5 script file
2. rqhelp.txt is the S-Plus 4.5 help file
3. rq.obj is the Fortran object file
4. rq.f is the Fortran source codeDownload all files at once: E080001.zip
Following are the S-Plus script file (rq1.ssc), fortran object file (rq.obj), and helpfile (rqhelp.txt) for implementing regression quantiles in S-Plus 4.5 for Windows. The code is a slight modification of the code available from Roger Koenker at University of Illinois, Urbana-Champaign. I have added a second testing function (rrs.full.test) in the script file that performs a hypothesis test for all slope parameters against the null model that includes just an intercept. The object file, rq.obj, was compiled with a Watcom Fortran compiler so that it can be dynamically loaded in S-Plus (Fortran source code, rq.f, is also available at this site). The script, object, and help files should be placed in a directory on your hard drive, say in a subdirectory under libraries for S-Plus 4.5, c:\Program Files\splus45\library\regq. After starting S-Plus you will source in the script files with the command
source("c:\\Program Files\\splus45\\library\\regq\\rq1.ssc")
The fortran object must be dynamically loaded at each session with the command
dyn.load("c:\\Program Files\\splus45\\library\\regq\\rq.obj")
The rq1.ssc script file contains many functions used with regression quantile analyses but the three used in the Ecology article were rq() for getting parameter estimates and rank-score confidence intervals for any specified model, rrs.test() for making hypothesis tests corresponding to rank-score confidence intervals when null model includes more parameters than an intercept, and rrs.full.test() for making hypothesis tests with rank-scores when null model includes only a parameter for the intercept. Probability values for an observed test statistic, Tn, from rrs.test() or rrs.full.test() are calculated in S-Plus by invoking the Chi-square distribution with df equal to difference between number of parameters in null and alternative models
1-pchisq(Tn, df)
The help file, rqhelp.txt, is an ASCII text file that can be viewed with any text editor like NOTEPAD. It contains example commands for rq() and rrs.test() functions. Roger Koenker has S-Plus files for Unix and older windows versions of S-Plus, as well additional information on regression quantiles. The BLOSSOM software on the U. S. Geological Survey web site has the ability to estimate regression quantiles using the same algorithm as in rq.obj, but hypothesis tests are based on a permutation argument.
ESA Publications | Ecological Archives | Permissions | Citation | Contacts