title: How to get confidence intervals by bootstrapping for quantile regressions by default
body: <p>In my statistics class we use Stata and since I'm an R user I want to do the same things in R. I've gotten the right results but it seems like a somewhat awkward way of getting something as simple as confidence intervals. </p>
  
  <p>Here's my crude solution:</p>
  
  <pre><code>library(quantreg)
  na = round(runif(100, min=127, max=144))
  f &lt;- rq(na~1, tau=.5, data=ds)
  s &lt;- summary.rq(f, se="boot", R=1000)
  coef(s)[1]
  coef(s)[1]+ c(-1,1)*1.96*coef(s)[2]
  </code></pre>
  
  <p>I've also experimented a little at the <em>boot</em> package but I haven't gotten it to work:</p>
  
  <pre><code>library(boot)
  b &lt;- boot(na, function(w, i){ 
          rand_bootstrap_sample = w[i]
          f &lt;- rq(rand_bootstrap_sample~1, tau=.5)
          return(coef(f)) 
          }, R=100)
  boot.ci(b)
  </code></pre>
  
  <p>Gives an error:</p>
  
  <blockquote>
    <p>Error in bca.ci(boot.out, conf, index[1L], L = L, t = t.o, t0 = t0.o,  : 
      estimated adjustment 'a' is NA</p>
  </blockquote>
  
  <p>My questions:</p>
  
  <ul>
  <li>What I wan't is to know if there is another better way of getting the confidence interval</li>
  <li>why is the bootstrap code complaining?</li>
  </ul>