6
$\begingroup$

I understand that quantile regression estimates the conditional quantile of some measured variable (call the variable $y$), but can you use quantile regression to estimate an unconditional quantile of a distribution? For example, if I had 100 data points

$$y_1,...,y_{100}\sim N(\mu, \sigma^2)$$

then I could use some method to try to estimate the true quantile of the distribution, i.e., $q = \mu + z_\alpha\sigma$. But if I don't have any covariate information, can I still use quantile regression to estimate some quantile of interest from my data $y$?

$\endgroup$

2 Answers 2

5
$\begingroup$

YES

This is just a quantile regression on an intercept and nothing else. The theory is similar to how OLS linear regression on just an intercept gives the mean.

Minimizing the sum of squared deviations gives the mean, and minimizing the sum of quantile loss values gives the quantile.

$\endgroup$
3
  • $\begingroup$ thanks for confirming my suspicions. I know it's an estimate, but do you actually recover the true form of the quantile of the distribution using quantile regression in this case? For example, if I knew the true quantile of my distribution was $q=\mu+z_\alpha\sigma$, does the quantile estimate lead to that equation? $\endgroup$ Commented Aug 10, 2023 at 19:27
  • $\begingroup$ @JohnSmith No, you are not guaranteed to get the true value when you estimate from data. $\endgroup$ Commented Aug 10, 2023 at 19:46
  • $\begingroup$ Sorry, I need to learn to better state my questions. What I meant by recover the true form, is whether or not solving analytically the formula for the quantile regression gives you back the closed form solution for the quantile of the distribution of interest. So no data here but just maths. I'm attempting now to put pencil to paper by math skills is admittedly not that great $\endgroup$ Commented Aug 10, 2023 at 20:09
9
$\begingroup$

Why not try it and see?

set.seed(1234)
library(quantreg)

x <- rnorm(1000)
m1 <- rq(x~1, c(0.1, 0.5, 0.9))
m1                            #-1.2121   -0.03965, 1.33418
quantile(x, c(0.1, 0.5, 0.9)) #-1.21322  -0.03979   1.3344

Interestingly, the estimates from quantile regression are not exactly the actual quantiles, although they are very close. I don't know why.

I also tried some other distributions, and some were a little less close than the one above.

$\endgroup$
7
  • 3
    $\begingroup$ Note that the quantile function has nine methods of performing the calculation. This can be changed using the type argument. $\endgroup$ Commented Aug 10, 2023 at 19:48
  • $\begingroup$ Do you know how to get the quantreg function to give a confidence interval on the quantile estimate? $\endgroup$ Commented Aug 10, 2023 at 20:31
  • $\begingroup$ You can use boot.rq to get CIs. $\endgroup$ Commented Aug 10, 2023 at 20:43
  • $\begingroup$ Thanks. Might you be able to provide a simple example? $\endgroup$ Commented Aug 10, 2023 at 20:46
  • 1
    $\begingroup$ @JohnSmith Of possible interest $\endgroup$ Commented Aug 11, 2023 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.