Announcement

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

  • Defining dummies.

    Dear All, I have this (unbalanced panel) data set
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long firm int year double CEOid int(CEOstart CFOstart)
    1 2000 30147524 13717 14693
    1 2005  3027280 16604 16604
    1 2006  3027280 16604 16604
    1 2007  3027280 16604 16604
    1 2008  3027280 16604 16604
    1 2009  3027280 16604 16604
    1 2010  3088526 18408 16604
    1 2011  3088526 18408 16604
    1 2012 30185376 19261 16604
    1 2013 30185376 19261 19471
    1 2014 30185376 19261 19471
    1 2015 30185376 19261 19471
    1 2016 30149118 20747 20564
    1 2017 30149118 20747 21075
    1 2018 30149118 20747 21075
    1 2019 30149118 20747 21075
    1 2020 30149118 20747 21075
    1 2021 30149118 20747 21075
    1 2022 30149118 20747 21075
    2 1999  3012296 14000 14283
    2 2002  3053716 14976 15411
    2 2003  3053716 14976 15411
    2 2004  3053716 14976 15411
    2 2005  3053716 14976 15411
    2 2006  3053716 14976 15411
    2 2007  3053716 14976 15411
    2 2008  3053716 14976 15411
    2 2009  3053716 14976 15411
    2 2010  3053716 14976 15411
    2 2011  3053716 14976 15411
    2 2012  3053716 14976 15411
    2 2013  3053716 14976 15411
    2 2014  3053716 14976 15411
    2 2015  3053716 14976 15411
    2 2016  3053716 14976 15411
    2 2017  3053716 14976 15411
    2 2018 30192166 21214 15411
    2 2019 30192166 21214 15411
    2 2020 30192166 21214 21991
    2 2021 30192166 21214 21991
    2 2022 30192166 21214 21991
    2 2023 30192166 21214 21991
    4 1999 30583185 13832 14609
    4 2000 30125324 14966 14967
    4 2002 30125324 14966 15572
    4 2003 30125324 14966 15572
    4 2004 30125324 14966 15572
    4 2005  3077184 16625 15572
    4 2006  3077184 16625 15572
    4 2007  3077184 16625 17380
    4 2008  3075086 17598 17380
    4 2009  3075086 17598 17380
    4 2010  3087394 18352 17380
    4 2011 30138572 18654 17380
    4 2012 30138572 18654 17380
    4 2019 30344026 21648 21721
    4 2020 30344026 21648 21721
    4 2021 30344026 21648 21721
    4 2022 30344026 21648 21721
    5 2001  3080180 15135 14365
    5 2010  3091370 17336 18430
    5 2011  3091370 17336 18430
    5 2012  3091370 17336 18430
    5 2013  3091370 17336 18430
    5 2014  3091370 17336 18430
    5 2015  3091370 17336 18430
    5 2016  3091370 17336 18430
    5 2017  3091370 17336 18430
    5 2018  3091370 17336 18430
    5 2019  3091370 17336 18430
    5 2022  3091370 17336 22825
    6 1998 30107458 14038 14031
    6 1999 30107458 14038 14031
    6 2000 30107458 14038 14031
    6 2001 30107458 14038 14031
    6 2002 30107458 14038 14031
    6 2003 30118516 15853 14031
    6 2004 30118516 15853 14031
    6 2005 30165448 16553 16525
    6 2006 30145990 16978 16525
    6 2007 30145990 16978 16525
    6 2008 30145990 16978 16525
    6 2009 30145990 16978 18107
    6 2010 30145990 16978 18107
    6 2011 30145990 16978 18107
    6 2012 30145990 16978 19214
    6 2013  3079234 19502 19214
    6 2014  3079234 19502 19214
    6 2015  3079234 19502 19214
    6 2016  3079234 19502 19214
    6 2017 30366949 20894 19214
    6 2018 30366949 20894 19214
    6 2019 30366949 20894 19214
    6 2020 30366949 20894 22063
    7 2000 30396966 14854 14335
    7 2001   304228 15194 14976
    7 2002 30112536 15553 14976
    7 2003 30112536 15553 14976
    7 2004 30160920 16435 14976
    7 2005 30160920 16435 14976
    end
    format %tdCCYY-NN-DD Astart
    format %tdCCYY-NN-DD Bstart
    For each firm and each year, I have information on CEO id (CEOid), and the start date (CEOstart) that he/she assumed office. In addition, I also have the start date (CFOstart) that the CFO assumed office.

    I'd like to define two dummies. The first dummy, say D1, is based on two requirements. The first one is CEOstart is less than or equal to CFOstart (CFO co-option). Given the first requirement, the second one is conditional on the CFO’s first 3 years of tenure (with the current CEO). The second dummy, say D2, is also based on the first requirement above, and is also conditional on the CFO’s fourth year of tenure and beyond. Please see the attached file for more explanation.

    Click image for larger version

Name:	CFO_co-option.png
Views:	1
Size:	20.0 KB
ID:	1713794





    Any suggestions are highly appreciated.
    Ho-Chuan (River) Huang
    Stata 19.0, MP(4)

  • #2
    Here is a solution with some caveats. Your rules for the indicator variables are not identical to the description provided in the image. I went by the description provided in the image to generate the indicator variables. You can adjust the rules in the code as you see fit.

    Code:
    format CEOstart CFOstart %td
    
    local today = mdy(05, 17, 2023)
    
    * Years since CFO was hired
    gen CFO_years = (`today' - CFOstart ) / 365
    
    * Indicator variable 1: CFO hired after CEO's appointment
    gen indicator1 = (CFOstart > CEOstart)
    
    * Indicator variable 2: CFO hired after CEO's appointment within the last 3 years
    gen indicator2 = (CFOstart > CEOstart & CFO_years <= 3)
    
    * Indicator variable 3: CFO hired after CEO's appointment four or more years ago
    gen indicator3 = (CFOstart > CEOstart & CFO_years >= 4)
    And, I didn't understand what the below two lines in your code mean:

    Code:
    format %tdCCYY-NN-DD Astart
    format %tdCCYY-NN-DD Bstart

    Comment


    • #3
      Dear Navi, Thanks a lot. It is very helpful. By the way, my bad. I change Astart/Bstart into CEOstart/CFOstart in the last moment.
      Last edited by River Huang; 18 May 2023, 02:09.
      Ho-Chuan (River) Huang
      Stata 19.0, MP(4)

      Comment

      Working...
      X