# Testing for statistical differences of quantile regression line slopes

If I were to compare the statistical similarity between the slopes of OLS regression lines from two independent samples, I would use a t-test to test if the slopes are equal or not. I'd like to compare the slopes of lines in a similar way obtained via quantile regression, however, I'm not sure if a t-test would be valid as the sample mean is used in the calculation.

Are there any specific methods used for this purpose? I've seen a lot of material on comparing OLS and quantile regression lines, or two OLS lines from independent samples but nothing on comparing two quantile regression lines in this way.

• Have a look at the paper "Small sample performance of quantile regression confidence intervals", G. Tarr 2012, Journal of Statistical Computation and Simulation for an empirical comparison of the state of the art approaches and pointers to asymptotic comparisons. Nov 20, 2014 at 8:18
• @user603: do you want to flesh out your comment a little and turn it into an answer? Nov 7, 2017 at 11:40
• @StephanKolassa: Thanks for the heads up. I will try to find time for it but it could be several weeks out. Nov 7, 2017 at 12:42
• @user603: anything new on this? It looks like we could really use some answers on testing quantile regression coefficients. Aug 8, 2018 at 21:02
• @user603: ping? Apr 1, 2020 at 18:03

I would approach this similar to how I would approach it in "regular" linear regression (OLS): model the two variables and their interaction, and do inference on the interaction term.

The interpretation of the interaction term is that it is the difference in slopes between the two levels of the group variable, and this is the same whether the approach is OLS or quantile regression. (The exact interpretation changes, since quantile regression models conditional quantiles instead of conditional means, but the idea of a line with a slope is the same.)

$$\mathbb E[y\vert x_1, x_2] = \beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3x_1x_2$$

Instead of fitting this model with OLS, fit it with quantile regression. Then you get a point estimate for $$\beta_3$$, the difference in slopes between the two groups in $$x_1$$.

Then you get into how to test for significance or create a confidence interval. I like the idea of testing via confidence interval and examining if $$0$$ is in the confidence interval. The quantreg package in R has a number of methods for calculating confidence intervals. I would do it with bootstrap. If you truly need a p-value, perhaps a permutation test of $$H_0: \beta_3 = 0$$ would work for you.

Couldn't you just run a pooled quantile regression y=betax + deltax*groupDummy? Seems easier to me, and presumably your favorite stats package will give you a confidence interval for delta. But I may be missing something.

• Do you mean something like a hypothesis test of confidence interval on the interaction term?
– Dave
Aug 16, 2021 at 3:03
• Yes, or even simpler actually you look at whether 0 is in the CI for the interaction term. Aug 17, 2021 at 12:24