Announcement

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

  • dummy variable for percentiles

    Hello Everyone,

    Could anyone help me to generate dummy variable equals one if some variable has values exceeds the 90th percentiles within its industry

  • #2
    You gave us no description of the format of your data. So, I'll guess that you have an industry variable, in which case something like the following would work:
    Code:
    bysort industry: egen above90 = pctile(YourVariableName), p(90)
    replace above90 = (YourVariableName > above90)

    Comment

    Working...
    X