Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7813461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:52:23+00:00 2026-06-02T04:52:23+00:00

In my statistics class we use Stata and since I’m an R user I

  • 0

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.

Here’s my crude solution:

library(quantreg)
na = round(runif(100, min=127, max=144))
f <- rq(na~1, tau=.5, data=ds)
s <- summary.rq(f, se="boot", R=1000)
coef(s)[1]
coef(s)[1]+ c(-1,1)*1.96*coef(s)[2]

I’ve also experimented a little at the boot package but I haven’t gotten it to work:

library(boot)
b <- boot(na, function(w, i){ 
        rand_bootstrap_sample = w[i]
        f <- rq(rand_bootstrap_sample~1, tau=.5)
        return(coef(f)) 
        }, R=100)
boot.ci(b)

Gives an error:

Error in bca.ci(boot.out, conf, index[1L], L = L, t = t.o, t0 = t0.o, :
estimated adjustment ‘a’ is NA

My questions:

  • What I wan’t is to know if there is another better way of getting the confidence interval
  • why is the bootstrap code complaining?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T04:52:27+00:00Added an answer on June 2, 2026 at 4:52 am

    Your example does not give an error message for me (Windows 7/64,R 2.14.2), so it could be a problem of random seeds. So if you post an example using some random method, better add a line set.seed; see example.

    Note that the error message refers to the bca type of boot.ci; since this one often complains, deselect it by giving type explicitly.

    I do not know exactly why you use the rather complex rq in the bootstrap. If you really wanted to profile rq, forget the simple example below, but please give some more details.

    library(boot)
    set.seed(4711)
    na = round(runif(100, min=127, max=144))
    
    b <- boot(na, function(w, i) median(w[i]), R=1000)
    boot.ci(b,type=c("norm","basic","perc"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build a statistics generator that should be able to use intervals
I am trying to use android.server.ProcessStats class to get cpu usage statistics (pcpu, idle
I am trying to use the ActivityManager class to get memory usage statistics of
Is it possible to use an autogenerated class in the same run as it
R is a statistics programming language. Part of R is the use of Packages,
I want to build some statistics on which Java standard library classes (those in
I am working on a website statistics engine for a class. The idea being
I have a template statistics class that has range parameters. template <typename T> class
public class StatisticsViewPresenter { private IStatisticsView view; private Statistics statsModel; public StatisticsViewPresenter(IStatisticsView view, Statistics
From the Oracle docs. A number representing one or more statistics class. The following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.