You can use the boot.rq function directly to load the coefficients:
x<-1:50 y<-c(x[1:48]+rnorm(48,0,5),rnorm(2,150,5)) QR <- rq(y~x, tau=0.5) summary(QR, se='boot') LM<-lm(y~x) QR.b <- boot.rq(cbind(1,x),y,tau=0.5, R=10000) t(apply(QR.b$B, 2, quantile, c(0.025,0.975))) confint(LM) plot(x,y) abline(coefficients(LM),col="green") abline(coefficients(QR),col="blue") for(i in seq_len(nrow(QR.b$B))) { abline(QR.b$B[i,1], QR.b$B[i,2], col='#0000ff01') }
You can use the boot package to calculate intervals other than the percentile interval.
source share