Following on my question for OLS, I wonder: what diagnostic plots exists for quantile regression? (and are there R implementation of them?)

A quick google search already came up with the worm plot$^\dagger$ (which I have never heard about before), and I'd be happy to know of more methods you might know about. (are any of them one from OLS ported for quantile-regression?)

$\dagger$ link dead

  • $\begingroup$ I presume you found the gamlss library has an implementation of the worm plot. $\endgroup$ Jan 22, 2012 at 2:02

1 Answer 1


Quantile regression does not make distributional assumptions, i.e., assumptions about residuals, other than assuming that the response variable is almost continuous. If you are addressing the problem of estimating a single quantile as a function predictors X, far and away the major things that can go wrong are misspecification of the linear predictor $X\beta$ by underfitting, i.e., failing to include nonlinear effects (a common problem) or interaction effects. There are at least two recommended approaches. First, if your sample size is large, just fit a more flexible model. A good compromise is to allow all main effects to be nonlinear using regression splines such as restricted cubic splines (natural splines). Then there is nothing that needs to be checked except for interactions. The second approach is to hope that the model is simple (why?) but allow it to be complex, then to assess the impact of the complex additions to the simple model. For example, we can assess the combined contributions of nonlinear or interaction terms or both. An example follows, using the R rms and quantreg packages. A compromise interaction form is used, to limit the number of parameters. The interactions are restricted to not be doubly nonlinear.

# Estimate 25th percentile of y as a function of x1 and x2
f <- Rq(y ~ rcs(x1, 4) + rcs(x2, 4) + rcs(x1, 4) %ia% rcs(x2, 4), tau=.25)
# rcs = restricted cubic spline, here with 4 default knots
# %ia% = restricted interaction
# To use general interactions (all cross product terms), use:
# f <- Rq(y ~ rcs(x1, 4)*rcs(x2, 4), tau=.25)
anova(f)   # get automatic combined 'chunk' tests: nonlinearity, interaction
# anova also provides the combined test of complexity (nonlin. + interact.)
  • $\begingroup$ How about using fractional polynomials instead of cubic splines? $\endgroup$
    – Mikołaj
    Feb 5 at 21:26
  • 1
    $\begingroup$ That works, assuming you account for the degrees of freedom used when computing standard errors, and you don't have zeros or negative values in a predictor. $\endgroup$ Feb 6 at 0:13
  • $\begingroup$ If I possess a quantile regression model (rq()) that includes both categorical and continuous dependent variables, how should one examine the interactions? a) Should anova() be conducted for each pair of variables, or should anova() be performed for the entire model? b) Furthermore, if I am investigating qr() for different tau values, such as 0.25, 0.5, or 0.75 - must I conduct an interaction assessment separately for each tau? $\endgroup$
    – Mikołaj
    Mar 10 at 18:36
  • $\begingroup$ This is where I'd rather use semiparametric models to get unified quantiles and the mean, as in here. I would also try to test interactions as a group. $\endgroup$ Mar 13 at 22:06

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.