Announcement

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

  • Percentile error

    hi.
    I am working with register data and I can't extract them to show you how it looks like. I try to explain clearly so. I have a simple population for thousands of neighborhoods. I sort the population across these neighborhoods. then I want to have percentile as this:
    xtile p=population, nquantiles(100)
    But when I tab I see the weird result as:
    tab p
    p No
    1 13000
    47 12456
    48 1700
    56 1560
    57 1498
    58 1333
    59 1200
    85 1000
    86 950
    87 932
    88 688
    89 512
    90 450
    91 315
    92 310
    93 300
    94 290
    95 289
    96 270
    97 251
    98 283
    99 290
    100 298
    I am very new to percentile and I do not know where I made mistake. But I should get the equal frequency and also g from 1 to 100. why I just get some quartile and not with even distribution?

  • #2
    No mistake in Stata terms, just a (frequent) misunderstanding, To get 100 bins with at least one value in each, it is necessary (but not sufficient) to have at least 100 distinct values. Further, values that are identical must end in the same bin (just as they do in any table or histogram). So ties can frustrate binning by quantiles. On the face of it your variable is utterly unsuitable for quantile binning.

    I will post some references later.

    Comment


    • #3
      Thanks for your reply! so how can I divide my population in percentile? indeed as I have a deprivation index, I need to make percentile and then plot percentile of the population with regard to deprivation. is there any way to do percentile for my poputaion?

      Comment


      • #4
        You can calculate a percentile rank. There is a FAQ on that on the Stata website, which

        Code:
        search percentile rank, faq
        should find.

        Why bin or even rank at all? That’s a way to throw away information.

        It is difficult for me to know why even a rank is preferable in any sense to using a deprivation index itself (possibly on a transformed scale, as I gather its distribution is highly skewed).

        Comment


        • #5
          References

          FAQ https://www.stata.com/support/faqs/s...ing-positions/

          Papers on quantile binning, and especially why it is often a disappointment verging on disaster:

          https://www.stata-journal.com/articl...article=pr0054 (PDF is free)

          https://www.stata-journal.com/articl...article=dm0095

          Comment


          • #6
            Thanks Nick!

            Comment

            Working...
            X