0

This is an extension from this question about 95% confidence intervals for quantile regression using rquant:

Calculating 95% confidence intervals in quantile regression in R using rq function

Here, the goal is to determine 95% confidence intervals for quantile regression for a polynomial fit.

Data:

x<-1:50
y<-c(x[1:50]+rnorm(50,0,5))^2

Attempt using the approach in the aforementioned question:

QR.b <- boot.rq(cbind(1,x,x^2),y,tau=0.5, R=1000)

t(apply(QR.b, 2, quantile, c(0.025,0.975)))
            2.5%      97.5%
[1,] -14.9880661 126.906083
[2,] -20.5603779   5.424308
[3,]   0.8608203   1.516513

But this of course determines the 95% CI for each coefficient independently, and would appear to overestimates the interval (see image below).

enter image description here

I had another idea for an approach simply determining the coefficients from a bootstrap sample of the data (i.e. rq(y~x+I(x^2)) on thousands of samples of y and x), but wanted to see if there is something build it to the package.

Community
  • 1
  • 1
Minnow
  • 1,733
  • 2
  • 26
  • 52
  • 1
    I don't understand how you derive a confidence band of predictions from the bootstrap intervals of the coefficients. That's generally not possible because the coefficients are not independent, i.e., covariances are not zero. You'll need to bootstrap the predictions. – Roland Apr 24 '17 at 18:11
  • @Rolad Thanks for the comment, I agree that the coefficients CIs are fatally flawed. Predictions it will be. – Minnow Apr 24 '17 at 19:55

0 Answers0