Announcement

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

  • How to create Treatment and Control Groups

    Dear All,
    I have a panel dataset, and I want to create a treatment and control group based on the CEO's death. Particularly, I want to do the followings:

    Treatment Group: It is equal to 1 if the firms have experienced reductions in their co-opted board ratios a year following the sudden death of a CEO.
    Control Groups: It is equal to 0, which includes businesses that have not experienced such reductions in their co-opted board ratios in the same year.

    My example dataset is as below:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long gvkey double fyear float(death BOARD_COOPTION)
    1004 1996 . 1
    1004 1997 . 0
    1004 1998 . 0
    1004 1999 . 0
    1004 2000 . 0
    1004 2001 . .25
    1004 2002 . .3333333
    1004 2003 . .5
    1004 2004 . .625
    1004 2005 . .8571429
    1004 2006 . .8888889
    1004 2007 . .9090909
    1004 2008 . .9090909
    1004 2009 . .9090909
    1004 2010 . .9
    1004 2011 . .9090909
    1004 2012 . .9090909
    1004 2013 . .9090909
    1004 2014 . .9090909
    1004 2015 . .9090909
    1004 2016 . .9166667
    1004 2017 . .9166667
    1013 1996 . .3
    1013 1997 . .3636364
    1013 1998 . .3636364
    1013 1999 . .3333333
    1013 2000 . .7
    1013 2001 . .625
    1013 2002 . .3
    1013 2003 . .3636364
    1013 2004 . 0
    1013 2005 . .3076923
    1013 2006 . .3333333
    1013 2007 . .4
    1013 2008 . .4
    1013 2009 . .5
    1034 1998 . .22222222
    1034 2000 . .11111111
    1034 2001 . .11111111
    1034 2002 . .3
    1034 2003 . .6666667
    1034 2004 . .6666667
    1034 2005 1 .7
    1034 2006 . .5
    1034 2007 . .5
    1045 1997 . .7
    1045 1998 . .75
    1045 1999 . .0909091
    1045 2000 . .2
    1045 2001 . .3
    1045 2002 1 .4166667
    1045 2015 . 0
    1045 2016 . .15384616
    1045 2017 . .15384616
    1045 2018 . .16666667
    1072 2000 . .5
    1072 2001 . .5
    1078 1996 . .1818182
    1078 1997 . .2
    1078 1998 . .4375
    1078 1999 . .07692308
    1078 2000 . .08333334
    1078 2001 . .23076923
    1078 2002 . .2857143
    1078 2003 . .3076923
    1078 2004 . .3076923
    1078 2005 . .3571429
    1078 2006 . .3846154
    1078 2007 . .4615385
    1078 2008 . .4615385
    1078 2009 . .53846157
    1078 2010 . .5833333
    1078 2011 . .8
    1078 2012 . .9090909
    1078 2013 . .9090909
    1078 2014 . .9090909
    1078 2015 . .9090909
    1078 2016 . .9090909
    1078 2017 . .9090909
    1078 2018 . .9166667
    1094 2015 . .2857143
    1094 2016 . .2857143
    1094 2017 . .375
    1094 2018 . .5714286
    1111 2003 . 1
    1111 2004 . 1
    1111 2005 . 1
    1111 2006 . 1
    1111 2007 . 1
    1115 1996 . .2
    1115 1997 1 .3333333
    1115 1998 . 0
    1115 1999 . .14285715
    1164 1996 . .625
    1164 1997 . .6666667
    1164 1998 . .7272727
    1164 1999 . .8235294
    1164 2000 . .7857143
    1164 2001 . .75
    1203 1996 . .375


    Many thanks for considering my request.

  • #2
    Code:
    replace death = 0 if missing(death)
    label define rx_group   0   "Control"   1   "Treatment"
    xtset gvkey fyear
    gen byte condition = death & (F.BOARD_COOPTION < BOARD_COOPTION)
    by gvkey: egen byte rx_group = max(condition)
    label values rx_group rx_group
    Notes:

    1. Having a yes/no variable (death) coded as 1/. is not a good idea in Stata. This code, in particular, will not work with that coding. But more generally, yes/no variables are best represented by 1/0 coding in Stata.

    2. Your data has some large time gaps. That is, for some gvkeys, the next fyear that appears in the data is not the year after the fyear that immediately precedes it. I have interpreted your condition as referring to the actual next calendar year in the universe, not the next calendar year that appears in the data. So if there is a death in 2004, and the next year in the data is 2007, then we do not have evidence that BOARD_COOPTION decreased in the next (i.e. 2005) year, so that gvkey would be assigned to control, not treatment. If that is not your intention, the code would have to be modified to work with "next year in the data set" as opposed to "next year in the universe."

    Comment


    • #3
      Dear Clyde Schechter . Thank you for this code. It worked for me. May I know how to modify this code if i want to see a reduction in board cooption after the CEO's death for two years instead of one year?
      Treatment Group: It is equal to 1 if the firms have experienced reductions in their co-opted board ratios two years following the sudden death of a CEO.
      Control Groups: It is equal to 0, which includes businesses that have not experienced such reductions in their co-opted board ratios in the same years.

      Thanks

      Comment


      • #4
        Dear Clyde Schechter . Thank you for this code. It worked for me. May I know how to modify this code if I want to see a reduction in board cooption after the CEO's death for two years instead of one year?
        Treatment Group: It is equal to 1 if the firms have experienced reductions in their co-opted board ratios two years following the sudden death of a CEO.
        Control Groups: It is equal to 0, which includes businesses that have not experienced such reductions in their co-opted board ratios in the same years.

        Thanks

        Comment


        • #5
          I don't understand whether you want treatment group to be 1 if the cooption ratios are less than the current year in both the year after and the second year after the death, or if you want it to be either the first or second year after the death, or if you want to ignore the first year after and look only at the second year.

          Comment


          • #6
            Dear Clyde Schechter, I want the treatment group to be 1 if the cooption ratios are less than the current year in both the year after and the second year after the death. Thanks

            Comment


            • #7
              Just change the -gen byte condition = ...- command to:
              Code:
              gen byte condition = death & (F.BOARD_COOPTION < BOARD_COOPTION) & (F2.BOARD_COOPTION < BOARD_COOPTION)

              Comment


              • #8

                Dear Clyde Schechter, thanks. It worked for me.

                Comment

                Working...
                X