Announcement

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

  • #16
    Originally posted by Clyde Schechter View Post
    If I understand this non co-opted index, it works the same as the one we've been working on up to now, but it includes in the numerator only those directors who started before the CEO, which is the opposite of what we have done before. I believe you can do this by changing:

    Code:
    by firm CEO year: egen numerator = total(cond(D_start < C_start), 0, days_served_with_ceo)
    to
    Code:
    by firm CEO year: egen numerator = total(cond(D_start >= C_start), 0, days_served_with_ceo)
    Everything else would work the same. As with the index worked on in the earlier posts of this thread, this is calculated as the fraction of all director-days during the CEO's term that involved non-co-opted directors. If it is to be based on the fraction of all directors, that would be a different calculation. If you want the code for an index based on directors, not director-days, post back and I'll work on that.
    Thanks again, Clyde. I have done some preliminary estimations using these two indices, and found some encouraging results.Your kind help will be acknowledged in our paper.
    Ho-Chuan (River) Huang
    Stata 17.0, MP(4)

    Comment


    • #17
      Originally posted by Clyde Schechter View Post
      Everything else would work the same. As with the index worked on in the earlier posts of this thread, this is calculated as the fraction of all director-days during the CEO's term that involved non-co-opted directors. If it is to be based on the fraction of all directors, that would be a different calculation. If you want the code for an index based on directors, not director-days, post back and I'll work on that.
      Dear Clyde: Another question arises. Suppose that I have one additional variable. The female (dummy) is equal to 1 if the director is a female, 0 otherwise. I'd like to calculate an index similar to the co-option index (the faction of directors after the CEO assumed office) discussed above. If particular, I want calculate a female co-option index which is defined as the fraction of (co-opted) female directors (in terms of weighted tenure) of the total (co-opted) directors, i.e., the faction of female directors after the CEO assumed office. How can I do that? I can make up an example data if you need.
      Ho-Chuan (River) Huang
      Stata 17.0, MP(4)

      Comment


      • #18
        Yes, it would be helpful if you provided example data.

        And just to be clear, you want an index based on co-opted female directors in the numerator and all co-opted directors (male or female) in the denominator. Is that right? Non co-opted directors do not figure in either the numerator nor the denominator, right?

        Comment


        • #19
          Originally posted by Clyde Schechter View Post
          Yes, it would be helpful if you provided example data.

          And just to be clear, you want an index based on co-opted female directors in the numerator and all co-opted directors (male or female) in the denominator. Is that right? Non co-opted directors do not figure in either the numerator nor the denominator, right?
          I slightly modify the previous data set. Specifically, I add two variables. The first one is D_female (as described earlier), and the other is the age of the director (D_age).

          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input byte firm str3 CEO int(C_start C_end) float year str2 Director byte(D_female D_age) int(D_start D_end)
          1 "C1"  18110 19358 2010 "D2" 0 56 18141 19144
          1 "C1"  18110 19358 2010 "D3" 1 48 18171 19205
          1 "C1"  18110 19358 2010 "D1" 1 51 17714 18870
          2 "C2a" 17898 18778 2010 "T4" 0 48 18294 19236
          2 "C2a" 17898 18778 2010 "T3" 1 51 18110 19205
          2 "C2a" 17898 18778 2010 "T1" 1 60 17714 18293
          2 "C2a" 17898 18778 2010 "T2" 0 55 17684 19144
          2 "C2a" 17898 18778 2011 "T4" 0 49 18294 19236
          2 "C2a" 17898 18778 2011 "T3" 1 52 18110 19205
          2 "C2a" 17898 18778 2011 "T2" 0 56 17684 19144
          2 "C2b" 18779 19874 2011 "T4" 0 49 18294 19236
          2 "C2b" 18779 19874 2011 "T2" 0 56 17684 19144
          2 "C2b" 18779 19874 2011 "T3" 1 52 18110 19205
          2 "C2b" 18779 19874 2012 "T3" 1 53 18110 19205
          2 "C2b" 18779 19874 2012 "T5" 1 46 19237 19966
          2 "C2b" 18779 19874 2012 "T6" 0 55 19145 19874
          2 "C2b" 18779 19874 2012 "T2" 0 57 17684 19144
          2 "C2b" 18779 19874 2012 "T4" 0 50 18294 19236
          2 "C2b" 18779 19874 2012 "T7" 1 46 19206 19935
          end
          format %tdnn/dd/CCYY C_start
          format %tdnn/dd/CCYY C_end
          format %tdnn/dd/CCYY D_start
          format %tdnn/dd/CCYY D_end
          1. Yes, the co-opted female director is exactly defined as you described. Indeed, I like to split the co-option index into two sub-indices: the first is this female co-option, and the second the male co-option. Of course, two sub-indices should sum to the whole co-option index.
          2. By the way, I also like to add another weight (in terms of multiplying the variable D_age) to the original components of co-option index to obtain a new measure of age-related co-option index. Any suggestions?
          Ho-Chuan (River) Huang
          Stata 17.0, MP(4)

          Comment


          • #20
            Yes, the co-opted female director is exactly defined as you described. Indeed, I like to split the co-option index into two sub-indices: the first is this female co-option, and the second the male co-option. Of course, two sub-indices should sum to the whole co-option index.
            Not as I understand it. If the denominator for both the female and male indices is all directors, then, yes, the female index and the male index will sum to the total index: it's just a partitioning of the numerator. But what I asked in #18 is different: the denominator in the female index is female directors, and the denominator in the male index is male directors. Those indices will not sum to the total index. It's the difference between sum of indices = a/b + c/d and total index = (a+c)/(b+d). So please clarify which denominator you want the index to have.

            Also, I don't have a firm enough grasp of the concept of these indices to propose how one might define an age-related index. Up to now, the focal criteria have been based on dichotomies: coopted or not, male or female. Do you have some cutoff in mind that distinguishes young from old directors? From what you write, it sounds like you actually want to in some way treat D_age as continuous and somehow multiply it into the index, but I do not grasp how you want to do that. Do you want the average age of the coopted directors?

            Comment


            • #21
              Originally posted by Clyde Schechter View Post
              Not as I understand it. If the denominator for both the female and male indices is all directors, then, yes, the female index and the male index will sum to the total index: it's just a partitioning of the numerator. But what I asked in #18 is different: the denominator in the female index is female directors, and the denominator in the male index is male directors. Those indices will not sum to the total index. It's the difference between sum of indices = a/b + c/d and total index = (a+c)/(b+d). So please clarify which denominator you want the index to have.

              Also, I don't have a firm enough grasp of the concept of these indices to propose how one might define an age-related index. Up to now, the focal criteria have been based on dichotomies: coopted or not, male or female. Do you have some cutoff in mind that distinguishes young from old directors? From what you write, it sounds like you actually want to in some way treat D_age as continuous and somehow multiply it into the index, but I do not grasp how you want to do that. Do you want the average age of the coopted directors?
              Well, if we do not consider the (different) time served in each year by each director, the female co-option index in my mind can be obtained as illustrated below. Suppose that there are 11 directors in a particular year. Among which, 7 are co-opted (later than the CEO). Thus, the overall co-option index is 7/11 (This is what we have done so far). I'd like to decompose this index into two parts.Assume that there are 3 females out of these 7 co-opted directors.The female co-option (sub)index is defined as 3/7, and of course, the male co-option sub(index) is defined as 4/7. These two indices are then added to 1 (3/7+4/7=7/7=1).

              Regarding the age-related co-option index, what I had in mind is to multiplied the time served by the director by his/her age (probably has to divided by the sum of the ages of all co-opted directors somewhere). I like to know the effects of older/younger co-option index on the variables of interests.
              Ho-Chuan (River) Huang
              Stata 17.0, MP(4)

              Comment


              • #22
                OK, I understand, you want the female index to reflect the proportion of all co-opted directors who are female (weighted by service with the CEO). There is a problem. In Firm 2, year 2012, there are no co-opted directors, so the index is 0/0 = undefined for that CEO. (The firm has another CEO that year who does serve with some co-opted directors. But averaging that CEO's index with an undefined index makes the overall index undefined.) How do you want to handle this situation?

                As for the age index, it's not my place to tell you about content, but an age-weighted average of service doesn't make a lot of sense to me. I assume you actually meant a service-weighted average of age, calculated including only the co-opted directors. If that's what you want, I think this does it:

                Code:
                .  
                * Example generated by -dataex-. To install: ssc install dataex
                clear
                input byte firm str3 CEO int(C_start C_end) float year str2 Director byte(D_female D_age) int(D_start D_end)
                1 "C1"  18110 19358 2010 "D2" 0 56 18141 19144
                1 "C1"  18110 19358 2010 "D3" 1 48 18171 19205
                1 "C1"  18110 19358 2010 "D1" 1 51 17714 18870
                2 "C2a" 17898 18778 2010 "T4" 0 48 18294 19236
                2 "C2a" 17898 18778 2010 "T3" 1 51 18110 19205
                2 "C2a" 17898 18778 2010 "T1" 1 60 17714 18293
                2 "C2a" 17898 18778 2010 "T2" 0 55 17684 19144
                2 "C2a" 17898 18778 2011 "T4" 0 49 18294 19236
                2 "C2a" 17898 18778 2011 "T3" 1 52 18110 19205
                2 "C2a" 17898 18778 2011 "T2" 0 56 17684 19144
                2 "C2b" 18779 19874 2011 "T4" 0 49 18294 19236
                2 "C2b" 18779 19874 2011 "T2" 0 56 17684 19144
                2 "C2b" 18779 19874 2011 "T3" 1 52 18110 19205
                2 "C2b" 18779 19874 2012 "T3" 1 53 18110 19205
                2 "C2b" 18779 19874 2012 "T5" 1 46 19237 19966
                2 "C2b" 18779 19874 2012 "T6" 0 55 19145 19874
                2 "C2b" 18779 19874 2012 "T2" 0 57 17684 19144
                2 "C2b" 18779 19874 2012 "T4" 0 50 18294 19236
                2 "C2b" 18779 19874 2012 "T7" 1 46 19206 19935
                end
                format %tdnn/dd/CCYY C_start
                format %tdnn/dd/CCYY C_end
                format %tdnn/dd/CCYY D_start
                format %tdnn/dd/CCYY D_end
                
                //    VERIFY START & END DATES ARE IN ORDER
                assert D_start <= D_end
                assert C_start <= C_end
                
                //    VERIFY EACH DIRECTOR OVERLAPS WITH CEO AND WITH YEAR
                assert !((D_end < C_start) | (D_start > C_end))
                assert !((D_end < mdy(1, 1, year)) | (D_start > mdy(12, 31, year)))
                
                gen ceo_begin_year = max(C_start, mdy(1,1,year))
                gen ceo_end_year = min(C_end, mdy(12,31,year))
                gen ceo_days = ceo_end_year - ceo_begin_year + 1
                format ceo_*_year %td
                gen days_served_with_ceo = min(D_end, ceo_end_year) - max(D_start, ceo_begin_year) + 1
                
                //    SERVICE WEIGHTED MEAN AGE OF CO-OPTED DIRECTORS
                by firm CEO year, sort: egen denominator = total(cond(D_start >= C_start, days_served_with_ceo, 0))
                by firm CEO year: egen numerator = total(cond(D_start >= C_start, days_served_with_ceo*D_age, 0))
                
                gen CEO_index = numerator/denominator
                
                //    NOW CALCULATE TIME-WEIGHTED AVERAGE OF CEO WTS TO CREATE FIRM-YEAR WEIGHT
                egen flag = tag(firm year CEO)
                by firm year, sort: egen fy_numerator = total(ceo_days*CEO_index*flag)
                by firm year: egen fy_denominator = total(ceo_days*flag)
                gen firm_year_wt = fy_numerator/fy_denominator

                Comment


                • #23
                  Originally posted by Clyde Schechter View Post
                  OK, I understand, you want the female index to reflect the proportion of all co-opted directors who are female (weighted by service with the CEO). There is a problem. In Firm 2, year 2012, there are no co-opted directors, so the index is 0/0 = undefined for that CEO. (The firm has another CEO that year who does serve with some co-opted directors. But averaging that CEO's index with an undefined index makes the overall index undefined.) How do you want to handle this situation?
                  1. I will check it out for the code later. Many thanks.
                  2. In the meantime,let's focus on the female co-option index. You raise a question that I did not think of. At this moment, my initial thought is to assign 0 to the female cp-option index in case that there are no co-opted female director. Another possibility is to replace a missing value in this case. There seems no easy way to do this. So, could you please advise me how to construct these two alternatives. I will decide later on which one is better suitable to my purpose.
                  Ho-Chuan (River) Huang
                  Stata 17.0, MP(4)

                  Comment


                  • #24
                    So version 1 of the female co-opted director index, with result set to zero for any CEO who does not serve with any co-opted directors:
                    Code:
                    * Example generated by -dataex-. To install: ssc install dataex
                    clear
                    input byte firm str3 CEO int(C_start C_end) float year str2 Director byte(D_female D_age) int(D_start D_end)
                    1 "C1"  18110 19358 2010 "D2" 0 56 18141 19144
                    1 "C1"  18110 19358 2010 "D3" 1 48 18171 19205
                    1 "C1"  18110 19358 2010 "D1" 1 51 17714 18870
                    2 "C2a" 17898 18778 2010 "T4" 0 48 18294 19236
                    2 "C2a" 17898 18778 2010 "T3" 1 51 18110 19205
                    2 "C2a" 17898 18778 2010 "T1" 1 60 17714 18293
                    2 "C2a" 17898 18778 2010 "T2" 0 55 17684 19144
                    2 "C2a" 17898 18778 2011 "T4" 0 49 18294 19236
                    2 "C2a" 17898 18778 2011 "T3" 1 52 18110 19205
                    2 "C2a" 17898 18778 2011 "T2" 0 56 17684 19144
                    2 "C2b" 18779 19874 2011 "T4" 0 49 18294 19236
                    2 "C2b" 18779 19874 2011 "T2" 0 56 17684 19144
                    2 "C2b" 18779 19874 2011 "T3" 1 52 18110 19205
                    2 "C2b" 18779 19874 2012 "T3" 1 53 18110 19205
                    2 "C2b" 18779 19874 2012 "T5" 1 46 19237 19966
                    2 "C2b" 18779 19874 2012 "T6" 0 55 19145 19874
                    2 "C2b" 18779 19874 2012 "T2" 0 57 17684 19144
                    2 "C2b" 18779 19874 2012 "T4" 0 50 18294 19236
                    2 "C2b" 18779 19874 2012 "T7" 1 46 19206 19935
                    end
                    format %tdnn/dd/CCYY C_start
                    format %tdnn/dd/CCYY C_end
                    format %tdnn/dd/CCYY D_start
                    format %tdnn/dd/CCYY D_end
                    
                    //    VERIFY START & END DATES ARE IN ORDER
                    assert D_start <= D_end
                    assert C_start <= C_end
                    
                    //    VERIFY EACH DIRECTOR OVERLAPS WITH CEO AND WITH YEAR
                    assert !((D_end < C_start) | (D_start > C_end))
                    assert !((D_end < mdy(1, 1, year)) | (D_start > mdy(12, 31, year)))
                    
                    gen ceo_begin_year = max(C_start, mdy(1,1,year))
                    gen ceo_end_year = min(C_end, mdy(12,31,year))
                    gen ceo_days = ceo_end_year - ceo_begin_year + 1
                    format ceo_*_year %td
                    gen days_served_with_ceo = min(D_end, ceo_end_year) - max(D_start, ceo_begin_year) + 1
                    
                    // INDEX OF CO-OPTED FEMALES: ALL CO-OPTED DIRECTORS
                    by firm CEO year, sort: egen denominator = total(cond(D_start >= C_start, days_served_with_ceo, 0))
                    by firm CEO year: egen numerator = total(cond(D_start >= C_start & D_female == 1, days_served_with_ceo, 0))
                    
                    //    SERVICE WEIGHTED MEAN AGE OF CO-OPTED DIRECTORS
                    // by firm CEO year, sort: egen denominator = total(cond(D_start >= C_start, days_served_with_ceo, 0))
                    // by firm CEO year: egen numerator = total(cond(D_start >= C_start, days_served_with_ceo*D_age, 0))
                    
                    //    FEMALE INDEX (WITH VALUE 0 IF NO COOPTED DIRECTORS)
                    gen CEO_index = numerator/denominator
                    replace CEO_index = 0 if denominator == 0
                    
                    //    NOW CALCULATE TIME-WEIGHTED AVERAGE OF CEO WTS TO CREATE FIRM-YEAR WEIGHT
                    egen flag = tag(firm year CEO)
                    by firm year, sort: egen fy_numerator = total(ceo_days*CEO_index*flag)
                    by firm year: egen fy_denominator = total(ceo_days*flag)
                    gen firm_year_wt = fy_numerator/fy_denominator
                    Version 2 of female co-opted director index, with value set to missing if any CEO in a given year serves with no co-opted directors:
                    Code:
                    * Example generated by -dataex-. To install: ssc install dataex
                    clear
                    input byte firm str3 CEO int(C_start C_end) float year str2 Director byte(D_female D_age) int(D_start D_end)
                    1 "C1"  18110 19358 2010 "D2" 0 56 18141 19144
                    1 "C1"  18110 19358 2010 "D3" 1 48 18171 19205
                    1 "C1"  18110 19358 2010 "D1" 1 51 17714 18870
                    2 "C2a" 17898 18778 2010 "T4" 0 48 18294 19236
                    2 "C2a" 17898 18778 2010 "T3" 1 51 18110 19205
                    2 "C2a" 17898 18778 2010 "T1" 1 60 17714 18293
                    2 "C2a" 17898 18778 2010 "T2" 0 55 17684 19144
                    2 "C2a" 17898 18778 2011 "T4" 0 49 18294 19236
                    2 "C2a" 17898 18778 2011 "T3" 1 52 18110 19205
                    2 "C2a" 17898 18778 2011 "T2" 0 56 17684 19144
                    2 "C2b" 18779 19874 2011 "T4" 0 49 18294 19236
                    2 "C2b" 18779 19874 2011 "T2" 0 56 17684 19144
                    2 "C2b" 18779 19874 2011 "T3" 1 52 18110 19205
                    2 "C2b" 18779 19874 2012 "T3" 1 53 18110 19205
                    2 "C2b" 18779 19874 2012 "T5" 1 46 19237 19966
                    2 "C2b" 18779 19874 2012 "T6" 0 55 19145 19874
                    2 "C2b" 18779 19874 2012 "T2" 0 57 17684 19144
                    2 "C2b" 18779 19874 2012 "T4" 0 50 18294 19236
                    2 "C2b" 18779 19874 2012 "T7" 1 46 19206 19935
                    end
                    format %tdnn/dd/CCYY C_start
                    format %tdnn/dd/CCYY C_end
                    format %tdnn/dd/CCYY D_start
                    format %tdnn/dd/CCYY D_end
                    
                    //    VERIFY START & END DATES ARE IN ORDER
                    assert D_start <= D_end
                    assert C_start <= C_end
                    
                    //    VERIFY EACH DIRECTOR OVERLAPS WITH CEO AND WITH YEAR
                    assert !((D_end < C_start) | (D_start > C_end))
                    assert !((D_end < mdy(1, 1, year)) | (D_start > mdy(12, 31, year)))
                    
                    gen ceo_begin_year = max(C_start, mdy(1,1,year))
                    gen ceo_end_year = min(C_end, mdy(12,31,year))
                    gen ceo_days = ceo_end_year - ceo_begin_year + 1
                    format ceo_*_year %td
                    gen days_served_with_ceo = min(D_end, ceo_end_year) - max(D_start, ceo_begin_year) + 1
                    
                    // INDEX OF CO-OPTED FEMALES: ALL CO-OPTED DIRECTORS
                    by firm CEO year, sort: egen denominator = total(cond(D_start >= C_start, days_served_with_ceo, 0))
                    by firm CEO year: egen numerator = total(cond(D_start >= C_start & D_female == 1, days_served_with_ceo, 0))
                    
                    //    SERVICE WEIGHTED MEAN AGE OF CO-OPTED DIRECTORS
                    // by firm CEO year, sort: egen denominator = total(cond(D_start >= C_start, days_served_with_ceo, 0))
                    // by firm CEO year: egen numerator = total(cond(D_start >= C_start, days_served_with_ceo*D_age, 0))
                    
                    //    FEMALE INDEX (WITH VALUE MISSING IF NO COPTED DIRECTORS)
                    gen CEO_index = numerator/denominator
                    by firm year, sort: egen no_copted_directors = max(denominator == 0)
                    
                    //    NOW CALCULATE TIME-WEIGHTED AVERAGE OF CEO WTS TO CREATE FIRM-YEAR WEIGHT
                    egen flag = tag(firm year CEO)
                    by firm year, sort: egen fy_numerator = total(ceo_days*CEO_index*flag)
                    by firm year: egen fy_denominator = total(ceo_days*flag)
                    gen firm_year_wt = fy_numerator/fy_denominator if !no_copted_directors

                    Comment


                    • #25
                      Originally posted by Clyde Schechter View Post
                      So version 1 of the female co-opted director index, with result set to zero for any CEO who does not serve with any co-opted directors:

                      Version 2 of female co-opted director index, with value set to missing if any CEO in a given year serves with no co-opted directors:
                      Thanks a lot, Clyde. I will go through the code kindly provided by you to understand its ideas.

                      Ho-Chuan (River) Huang
                      Stata 17.0, MP(4)

                      Comment


                      • #26
                        Originally posted by Clyde Schechter View Post
                        So version 1 of the female co-opted director index, with result set to zero for any CEO who does not serve with any co-opted directors:
                        Dear Clyde, May ask another question? I have the following information for directors of two firms (In fact, I need to do the same thing for CEOs. But I think the procedure should be quite similar, and even simpler. So, I ask only the case of directors). I 'd like to first calculate the "cumulative" (from the very beginning of the sample period/year) tenure for each director if he/she is taking the director position in a particular year. Then, taking average tenure of all directors in that particular year. So, finally, I have time series observations (one for each year) from 2008-2016 for the first firm, and 2008-2017 for the second firm. A sample data set is below.

                        Code:
                        * Example generated by -dataex-. To install: ssc install dataex
                        clear
                        input byte firm str2 Director int(D_start D_end)
                        1 "D1" 17714 18870
                        1 "D2" 18141 19144
                        1 "D3" 18171 19205
                        1 "D1" 18871 19601
                        1 "D2" 19510 20239
                        1 "D4" 19206 19935
                        1 "D5" 19602 20331
                        1 "D2" 20240 20970
                        1 "D3" 19936 20666
                        2 "T1" 17714 18293
                        2 "T4" 18294 19236
                        2 "T2" 17684 19144
                        2 "T3" 18110 19205
                        2 "T4" 18294 19236
                        2 "T2" 17684 19144
                        2 "T3" 18110 19205
                        2 "T4" 18294 19236
                        2 "T5" 19237 19966
                        2 "T2" 17684 19144
                        2 "T6" 19145 19874
                        2 "T3" 18110 19205
                        2 "T7" 19206 19935
                        2 "T5" 19967 21062
                        2 "T8" 19875 20970
                        2 "T7" 19936 21031
                        end
                        format %tdnn/dd/CCYY D_start
                        format %tdnn/dd/CCYY D_end
                        If you find the description not clear, Let me know. I will try to explain again.


                        Ho-Chuan (River) Huang
                        Stata 17.0, MP(4)

                        Comment


                        • #27
                          If I'm understanding you correctly, it sounds like you want to create a data set with one observation for each firm-Director pair in each year, and showing the total length of service to that firm by that director up to and including that year. Then, for each firm-year combination you want to average that last result across directors.

                          Code:
                          //    BREAK EACH TENURE RECORD INTO SEPARATE RECORDS
                          //    FOR EACH YEAR IT TOUCHES
                          gen long obs_no = _n
                          gen start_year = yofd(D_start)
                          gen end_year = yofd(D_end)
                          expand end_year - start_year + 1
                          by obs_no, sort: gen year = start_year + _n - 1
                          
                          //    NOW SUM EACH DIRECTOR'S SERVICE PERIODS IN EACH YEAR
                          gen service_this_year = min(D_end, mdy(12, 31, year)) - max(D_start, mdy(1, 1, year)) + 1
                          collapse (sum) service_this_year , by(firm Director year)
                          by firm Director (year), sort: gen cumulative_service = sum(service_this_year)
                          //    NOW COMPUTE AVERAGE TENURE OF ALL DIRECTORS IN THAT PARTICULAR YEAR
                          by firm year, sort: egen average_tenure = mean(cumulative_service)
                          Now, there is one problem here. The resulting data set is not a time series, nor even a panel data set, because there are multiple observations for a given firm-year combination. But the variable showing the cumulative-tenure of each director up to that year does vary within firm-year dyad, so you cannot eliminate it. What we have here is panel data where the panel is the firm-Director pairing, along with an additional variable that averages cumulative tenure across the firm-year. If you need a panel of firm-years, then you will have to drop the director-specific variables to get that:

                          Code:
                          drop Director service_this_year cumulative_service
                          duplicates drop
                          sort firm year

                          Comment


                          • #28
                            Originally posted by Clyde Schechter View Post
                            If I'm understanding you correctly, it sounds like you want to create a data set with one observation for each firm-Director pair in each year, and showing the total length of service to that firm by that director up to and including that year. Then, for each firm-year combination you want to average that last result across directors.
                            Thanks again, Clyde. I will try it out ASAP.
                            Ho-Chuan (River) Huang
                            Stata 17.0, MP(4)

                            Comment


                            • #29
                              Originally posted by Clyde Schechter View Post
                              If I'm understanding you correctly, it sounds like you want to create a data set with one observation for each firm-Director pair in each year, and showing the total length of service to that firm by that director up to and including that year. Then, for each firm-year combination you want to average that last result across directors.
                              Dear Clyde,

                              How can I modify the code in #27 to calculate the (cumulative) tenure for CEOs? A sample data set is below. There are two firms. CEO A1 served from 8/1/2009 to 12/31/2012. Then, CEO A2 took the position and served from 1/1/2013 to 5/31/2015. In the year 2015, A1 come back and continued to serve another term from 6/1/2015 to 10/31/2017. I'd like to obtain CEO (cumulative) tenure for each firm-year. In the year 2015, there are two CEOs, present. Thus, we first calculate the (cumulative) tenure for A1 and A2, respectively. Then, using the days of service in that year as weights to calculate a weighted tenure in that year. Any suggestions? Thanks.

                              Code:
                              * Example generated by -dataex-. To install: ssc install dataex
                              clear
                              input byte firm str2 CEO int(C_start C_end)
                              1 "A1" 18110 19358
                              1 "A2" 19359 20239
                              1 "A1" 20240 21123
                              2 "B1" 17898 18778
                              2 "B1" 18779 19509
                              2 "B2" 19510 20208
                              2 "B1" 20209 20939
                              end
                              format %tdnn/dd/CCYY C_start
                              format %tdnn/dd/CCYY C_end
                              Ho-Chuan (River) Huang
                              Stata 17.0, MP(4)

                              Comment


                              • #30
                                I think this does it, if I understand the problem correctly:

                                Code:
                                * Example generated by -dataex-. To install: ssc install dataex
                                clear
                                input byte firm str2 CEO int(C_start C_end)
                                1 "A1" 18110 19358
                                1 "A2" 19359 20239
                                1 "A1" 20240 21123
                                2 "B1" 17898 18778
                                2 "B1" 18779 19509
                                2 "B2" 19510 20208
                                2 "B1" 20209 20939
                                end
                                format %tdnn/dd/CCYY C_start
                                format %tdnn/dd/CCYY C_end
                                
                                //    FIRST EXPAND DATA TO CREATE AN OBSERVATION
                                //    FOR EACH YEAR IN EACH FIRM/CEO PAIR
                                assert C_start < C_end
                                gen first_year = yofd(C_start)
                                gen last_year = yofd(C_end)
                                gen obs_no = _n
                                expand last_year - first_year+ 1
                                by obs_no, sort: gen year = first_year + _n - 1
                                
                                //    CALCULATE DAYS OF SERVICE BY EACH CEO IN EACH YEAR
                                gen service = min(C_end, mdy(12, 31, year)) - max(C_start, mdy(1, 1, year)) + 1
                                by firm CEO (year), sort: gen cum_tenure = sum(service)
                                
                                //    CALCULATE PROPORTION OF CUMULATIVE TENURE SERVED BY EACH CEO IN EACH YEAR
                                by firm year (CEO), sort: egen total_cum_tenure = total(cum_tenure)
                                gen ceo_weight_this_year = cum_tenure/total_cum_tenure

                                Comment

                                Working...
                                X