Announcement

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

  • Generating a 95th percentile indicator variable

    Hi, I am a senior in college working on an economics thesis.

    I am trying to generate a dummy variable which would yield 1 if the observation is in the 95th percentile of the variable and a 0 otherwise. The variable in question is "inflation" and the new variable would be named "extremeinflation". The data is panel, not sure if this would make a difference in the syntax that I need.


    I believe I should be using the command pctile in some kind of manner but I am confused on the exact syntax that I should be using.


    Anything helps!

    Thank you very much.

  • #2
    The data is panel, not sure if this would make a difference in the syntax that I need.
    Well, it's hard to say because your question is not stated clearly enough. Do you want a 95th percentile separately within each panel, or do you want an overall 95th percentile for inflation across all panels? The syntax would, indeed, be different.

    Comment


    • #3
      Clyde Schechter made a good point. In addition, I guess you want an indicator for being above, or above or equal to, the 95th percentile. I would not recommend the terminology “in the 95th percentile” for either.

      Comment


      • #4
        Sorry for not being clear. My inflation data is panel and I am only looking to find the observations that occur when equal to or greater than the 95th percentile. So I would be looking an overall 95th percentile across all panels.

        Comment


        • #5
          summarize, detail will give you the 95th percentile after which you create an indicator.

          Comment


          • #6
            Thank you, Nick!

            Comment

            Working...
            X