Announcement

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

  • Generating Dummy variable for two consecutive years with the condition that the dummy will be equal to a percentage of another variable

    Hello everyone, I am trying to construct an overconfidence measure, namely Holder 67. The director will be defined as an overconfident if her exercisable options in the moneyness are at least 67% in two successive years. I have constructed the variable moneyness. However, I need help for the construction of Holder 67, which needs to equal or exceeds 67% of moneyness for two consecutive years.
    So far I have tried the following code, which does not generate the desired results. I would really appreciate some guidance. Thank you in advance.

    install dataex
    clear input byte Director int year float moneyness end sort Director year by ceo: generate Holder67 = sum(conf>=.67) by ceo: replace Holder67 = 0 if Holder67[_N]<2 by ceo: replace Holder67 = 1 if Holder67>1
Working...
X