How to obtain a 0 intercept in quantile regression 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:
library(quantreg)
library(tidyverse)

# Load the data and solve a linear regression model
data(engel)
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$

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.
