Announcement

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

  • Create rank variable for regression analysis

    Dear Statalisters,

    I want to run a panel data regression S on x1,x2, x3, x4. Following prior research, I want to convert all continuous variables to 0-99 percentile ranks.

    Panel id: firmid. Time id: year

    What I did:

    bysort year: egen srank=rank(S)
    bysort year: egen x1rank=rank(x1)

    sum srank ranges from 1 to 1144

    my sample has around 25000 observations.

    Question: how do I convert the ranks of all my variables to 0-99 percentile?

    Thanks,
    Rochelle

  • #2
    FAQ

    http://www.stata.com/support/faqs/st...ons/index.html

    Comment


    • #3
      yes, Nick. I actually found your FAQ before I post to the forum. that is why I used egen. I got ranks, but they are not bounded in 0-99 range.

      I hope this is not a stupid question: is it possible to make all the ranks within 0-99 range, that is after I
      bysort year: egen srank=rank(S)
      bysort year: egen x1rank=rank(x1)

      can I make srank and x1rank both bounded in 0-99 range.

      Comment


      • #4
        This really is answered in the FAQ cited. I draw your attention to the section on plotting positions ending

        All of these examples return results between 0 and 1; for percentages, just multiply by 100.

        Comment


        • #5
          You are absolutely right. Thanks you Nick !

          Best wishes,
          Rochelle

          Comment

          Working...
          X