R Programming/Quantile Regression

Quantile regression is a very old method which has become popular only in the last years thanks to computing progress. One of the main researcher in this area is also a R practitioner and has developed a specific package for quantile regressions (quantreg),.

In theory, Quantile regression are also linear and thus could have been included in the Linear regression page. However, this is a very specific topic and we think that it is worth writing a specific page for this topic.

Simple quantile model
We simulate from a simple quantile model. We first generate a uniform error term u and a covariate x.

We estimate the quantile model for some values of tau (the quantile) and plot the coefficients :

We then plot the scatterplot, the predicted values using a standard linear model and the predicted values using a quantile linear model :

We can also estimate the model for all quantiles at the same time :

Computing time
For large data sets it is better to use the "fn" or "pfn" method.

Resources

 * Koenker, Roger (2005) Quantile Regression, Cambridge University Press. ISBN 0-521-60827-9