Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Confidence interval for interquartile range

    Dear Statalist members, I would be most thankful for an advice. I need to estimate the confidence intervals for interquartile range. As a first step, I use the interquartile regression, and predict option to get iqr and standard deviation.

    iqreg y i.x , reps(100)

    predict iqr_est
    predict iqr_est_sd, stdp

    This gives me, as I understand the bootstrapped estimate of the IGR and the SD. However, I am at loss how to get a good estimate of confidence interval. Would be very thankful for any tip!

  • #2
    Hi Olga,
    What exactly is what you are trying to estimate the Confidence interval for?
    The interquantile range, conditional for characteristics? or the interquantile rage over the whole distribution?
    Fernando

    Comment


    • #3
      Hi Fernando, thank you for your answer - and the good question! I need the confidence bands for the second - the interquantile range over the distribution.

      Comment


      • #4
        If you want the CI for the IQR of the overall distribution, then you don't want/need -iqreg-. Rather, you need some program that produces the iqr as a descriptive statistic. The simplest command I could figure out to use was -tabstat- and extract the iqr from the return list matrix in which it is returned, which requires the modestly obscure function el(MatrixName, Row, Col) . Perhaps there is a more straightforward way to get the IQR as a descriptive statistic in a directly accessible form, but I don't happen to know it:
        Code:
        tabstat y, stat(iqr) // get the descriptive stat
        bootstrap iqr = el(r(StatTotal), 1, 1), reps(1000): tabstat y, stat(iqr) save 
        mat list e(ci_percentile) //display the CI
        I'd use the percentile CI rather than the normal approximation because I doubt very much that the sampling distribution of the IQR is normal.

        Comment


        • #5
          In addition to Mike's Advice, i would also say that iqreg can be used for the same purpose
          Code:
          webuse nlswork, clear
          bootstrap iqr = el(r(StatTotal), 1, 1), reps(100) seed(100): tabstat ln_wage, stat(iqr) save
          iqreg ln_wage,  q(25 75)
          *or bootstrapping the iqreg. This will be much slower tho
          bootstrap, reps(100) seed(100):iqreg ln_wage,  q(25 75)

          Comment


          • #6
            Thank you very much for your generous and quick help!

            Comment

            Working...
            X