Quantile regression models are a type of models that provide estimates of the quantiles of a response variable $y$ given a set of covariates $X$ in the form of a linear equation such as

$$ y = \beta_0 + \beta_1 x_1 + \ldots \beta_p x_p$$

where the $\beta$ coefficients vary depending on the quantile for which the model is solved. My question is: what are the requirements under which $\beta_0=0$?

For example, if instead of a quantile regression model we were solving a ordinary least squares linear regression model, I would know that, if both $y$ and $X$ are centered, then $\beta_0$ would be 0. Is there something equivalent for quantile regression?

See the following example:


# Load the data and solve a linear regression model
lm(income ~ foodexp, data=engel)$coefficients %>% round(3)

(Intercept)     foodexp 
-85.736323     1.711462 

# Center the data and solve the model again
# Here the intercept takes value 0 and the slope is the same as before
engel_scaled = scale(engel, scale=F) %>% data.frame()
lm(income ~ foodexp, data=engel_scaled)$coefficients %>% round(3)

(Intercept)     foodexp 
  0.000       1.711

# Now using a quantile regression model.
rq(income ~ foodexp, data=engel, tau=0.5)$coefficients %>% round(3)

(Intercept)     foodexp 
-14.961       1.548 

What transformation would we need to do on $y$ and $X$ so that the intercept of the quantile regression model is $0$ instead of $-14.96$

  • $\begingroup$ Use a -1 in the formula to remove the intercept. E.g. income ~ foodexp-1 This is the same for lm and rq. $\endgroup$ Jul 6 at 14:40
  • 1
    $\begingroup$ Thank you for your answer. What you propose is to fit a model without the intercept, but that is not what I am asking. If I fit a model without intercept, the slope will be different. What I want is to understand how the intercept in quantile regression is related to the data. Eg, in least squares regression the intercept is related to the mean value of $X$ and $y$. $\endgroup$ Jul 6 at 15:02

You can simply add 14.96 to income:

income_med_adj <- engel$income + 14.96
rq(income_med_adj ~ foodexp, data=engel, tau=0.5)$coefficients %>% round(3)

Of course, this would be different for different quantiles.

  • $\begingroup$ Thank you for your answer. That would solve the specific example I posed, but I would be interested in a more general explanation. In the lm model I can have a model that has 0 intercept without solving first the model with the intercept and then substracting, because I know that the intercept is related to the mean values of $X$ and $y$. Is there something similar in quantile regression? $\endgroup$ Jul 6 at 15:06
  • 1
    $\begingroup$ Not that I know of, which is not to say it is impossible. $\endgroup$
    – Peter Flom
    Jul 6 at 16:00
  • $\begingroup$ @PeterFlom: Please see request for information about CV.SE work here. $\endgroup$
    – Ben
    Aug 27 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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