7
$\begingroup$

Why use quantile regression instead of splitting the data in quantiles and calculating multiple linear regressions?

What are the advantages and disadvantages of these methods?

As far as I understand quantile regression is based on the median and therefore more outlier resistant, however I could also split the data in quantiles and could calculate median regressions for each quantile?

$\endgroup$
6
  • 4
    $\begingroup$ Note that a particular quantile (conditional on predictors) is a point, not a band. Suppose you are interested in the 0.75 quantile (upper quartile). What fraction of the data would you select and how would you select it? The larger point is that you need the entire data set to do what quantile regression does. What you propose is a different method and may not be feasible, unless you can sketch a plausible algorithm. Quantile regression is not "based on" the median; that is just the most common application. Generally, if you are imagining bands you have to say how wide they would be. $\endgroup$
    – Nick Cox
    Jan 16, 2016 at 16:14
  • $\begingroup$ Further quantile regression is not implemented using any kind of least squares, as multiple regression (without further qualification) is generally taken to be. $\endgroup$
    – Nick Cox
    Jan 16, 2016 at 16:16
  • 1
    $\begingroup$ How exactly to you propose to split the data? The function that returns Y's quantiles given X is unknown. $\endgroup$
    – Adrian
    Jan 16, 2016 at 16:19
  • $\begingroup$ Well assuming I have 2000 observations of my dependent variable I could sort it in ascending order and then split the data set based on this ordner in five equal parts a 400 observations. With the sub data sets I could then calculate multiple linear or median regressions. $\endgroup$
    – florian
    Jan 16, 2016 at 16:31
  • 4
    $\begingroup$ In addition to Nick's remark also note that the $\tau^{\text{th}}$ conditional quantile $Q_\tau(y)$ is not the same as the conditional quantile $Q_\tau(y|x)$. Given that there is no law of iterated quantiles, you cannot simply go back and forth between the two as you can for the conditional and unconditional mean using the law of iterated expectations. This makes the selection of quantiles followed by OLS on the selected data points even more unintuitive. $\endgroup$
    – Andy
    Jan 16, 2016 at 17:55

1 Answer 1

5
$\begingroup$

You need to look at the difference between conditional and unconditional quantiles.

Your approach analyzes unconditional quantiles of $y$, and how they depend on $x$. That may be a worthwhile question to ask, but it is not the question that quantile regression discusses.

Quantile regression analyzes quantiles of $y$ conditional on $x$. That is: given a value of $x$, what is the likely quantile of the conditional distribution of $y$ for exactly this $x$?

Let's simulate a little data.

qr 1

Quantile regression will fit a line (in the simplest case, a linear relationship with $x$, i.e., a straight line) such that at each value of $x$, we expect a certain percentage of the data to lie above this line. Here, I am working with an 80% quantile:

qr 2

The approach you propose amounts to cutting off the top 20% of the $y$ without regard to $x$. Graphically, that amounts to putting a horizontal line through the point cloud and then looking at the points above this line:

qr 3

An analysis of these points may be useful. But it will simply be a different analysis than quantile regression. You may be able to say something about the distribution of $x$ among your top 20% of $y$. But you will not be able to say anything about the conditional quantile of $y$ for any given $x$.

R code for the plots:

n_points <- 2000
set.seed(1)
xx <- rnorm(n_points)
yy <- xx+rnorm(n_points)

qq <- 0.8

width <- 400
height <- 400

png("qr_1.png",width=width,height=height)
    par(mai=c(.8,.8,.1,.1),las=1)
    plot(xx,yy,pch=19,cex=0.6)
dev.off()

library(quantreg)
model <- rq(yy~xx,tau=qq)
png("qr_2.png",width=width,height=height)
    par(mai=c(.8,.8,.1,.1),las=1)
    plot(xx,yy,pch=19,cex=0.6,col="lightgray")
    abline(model,lwd=1.5,col="red")
    index <- yy>=predict(model)
    points(xx[index],yy[index],pch=19,cex=0.6)
dev.off()

png("qr_3.png",width=width,height=height)
    par(mai=c(.8,.8,.1,.1),las=1)
    plot(xx,yy,pch=19,cex=0.6,col="lightgray")
    index <- yy>=quantile(yy,qq)
    points(xx[index],yy[index],pch=19,cex=0.6)
dev.off()
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.