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.

  • 3
    $\begingroup$ 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. $\endgroup$
    – user603
    Commented Nov 20, 2014 at 8:18
  • 3
    $\begingroup$ @user603: do you want to flesh out your comment a little and turn it into an answer? $\endgroup$ Commented Nov 7, 2017 at 11:40
  • $\begingroup$ @StephanKolassa: Thanks for the heads up. I will try to find time for it but it could be several weeks out. $\endgroup$
    – user603
    Commented Nov 7, 2017 at 12:42
  • 2
    $\begingroup$ @user603: anything new on this? It looks like we could really use some answers on testing quantile regression coefficients. $\endgroup$ Commented Aug 8, 2018 at 21:02
  • 1
    $\begingroup$ A bit related: given a single sample, how to test a hypothesis that the slopes for several different quantiles are equal: "Testing equality of quantile regression slopes at different quantiles". $\endgroup$ Commented Dec 29, 2020 at 11:04

2 Answers 2


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.

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

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.