"rq"
or "rq.process"
that represents
a quantile regression fit.rq(formula, tau=.5, data, weights, na.action,
method="br", contrasts, ...)
~
operator,
and the terms, separated by +
operators, on the right.tau
in (0,1) are desired. In the former case an
object of class na.fail
) is to create an error if any missing values are
found. A possible alternative is
l1fit
in S, and is described iNULL
appearing in the model formula.
The elements of the list should have the same name as the variable
and should be either a contrast matrix (specifically, any rq.object
and rq.process.object
for details.lm()
, the function presumes a linear
specification for the quantile regression model, i.e. that the formula
defines a model that is linear in parameters. For non-linear quantile
regression see the function nlrq()
. [To appear real soon now on
a screen near you.] The function minimizes a weighted sum of absolute
residuals that can be formulated as a linear programming problem. As
noted above, there are three different algorithms that can be chosen
depending on problem size and other characteristics. For moderate sized
problems ($n \ll 5,000, p \ll 20$) it is recommended that the default
"br"
method be used. There are several choices of methods for
computing confidence intervals and associated test statistics. Using
"br"
the default approach produces confidence intervals for each
of the estimated model parameters based on inversion of a rank test.
See the documentation for rq.fit.br
for further details
and options. For larger problems, the "fn"
and "pfn"
are
preferred, and there are several methods of computing standard errors
and associated test statistics described in the help files for
rq.fit.fn
, and summary.rq
.[2] Koenker, R.W. and d'Orey (1987, 1994). Computing regression quantiles. Applied Statistics, 36, 383--393, and 43, 410--414.
[3] Gutenbrunner, C. Jureckova, J. (1991). Regression quantile and regression rank score process in the linear model and derived statistics, Annals of Statistics, 20, 305--330.
[4] Koenker, R. W. (1994). Confidence Intervals for regression quantiles, in P. Mandl and M. Huskova (eds.), Asymptotic Statistics, 349--359, Springer-Verlag, New York.
There is also recent information available at the URL:
summary.rq
, rq.object
,
rq.process.object
data(stackloss)
rq(stack.loss ~ stack.x,.5) #median (l1) regression fit for the stackloss data.
rq(stack.loss ~ stack.x,.25) #the 1st quartile,
#note that 8 of the 21 points lie exactly on this plane in 4-space
rq(stack.loss ~ stack.x, tau=-1) #this returns the full rq process
rq(rnorm(50) ~ 1, ci=F) #ordinary sample median --no rank inversion ci
rq(rnorm(50) ~ 1, weights=runif(50),ci=F) #weighted sample median
Run the code above in your browser using DataLab