Announcement

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

  • synthetic control method panel data

    Good evening.
    I would like your help. I have panel data (company years and some variables). The variable of interest is the binary variable named Listed (0 before IPO and 1 when firm goes public ) and the outcome is the Etr index. The companies entered the stock market in different years (START VARIABLE). I want to apply the synthetic control method and examine the effect of the entry company in the stock market on the ETP indicator. It is difficult, I think.

    dataex econ_year firm_id listed ETR ROA SIZE_CONTROL start stop

    ----------------------- copy starting from the next line -----------------------
    [CODE]
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int econ_year float firm_id byte listed float(ETR ROA SIZE_CONTROL) str30(start stop)
    2004 790 0 .34032205 .5467306 13.872245 "12-Δεκέμβριος-1994" ""
    2005 790 0 .3007714 .676904 14.046932 "12-Δεκέμβριος-1994" ""
    2006 790 0 .31999955 .22212203 13.965886 "12-Δεκέμβριος-1994" ""
    2007 790 0 .28999993 .5441705 15.573822 "12-Δεκέμβριος-1994" ""
    2008 790 0 .24977253 .6065632 15.22519 "12-Δεκέμβριος-1994" ""
    2009 790 0 .25224 .27402616 15.515424 "12-Δεκέμβριος-1994" ""
    2010 790 0 .25 .1799916 15.323702 "12-Δεκέμβριος-1994" ""
    2011 790 0 0 -.08687542 15.288954 "12-Δεκέμβριος-1994" ""
    2012 790 0 0 -.04736073 15.179316 "12-Δεκέμβριος-1994" ""
    2013 790 0 -.08996403 -.04128758 15.017408 "12-Δεκέμβριος-1994" ""
    2014 790 0 0 -.08345628 14.939968 "12-Δεκέμβριος-1994" ""
    2015 790 0 0 .011874527 14.819736 "12/12/1994" ""
    2016 790 0 0 -.07755072 14.74357 "12/12/1994" ""
    2017 790 1 0 .03270987 14.832586 "12/12/1994" ""
    2018 790 0 0 -.29000336 14.64794 "12/12/1994" ""
    2019 790 0 0 .10894744 15.357953 "12/12/1994" ""
    2018 971 1 .1795453 .015156684 23.41389 "2/8/1950" ""
    2019 971 1 0 -.05952055 23.32465 "2/8/1950" ""
    2018 973 1 .3649029 .05821802 19.71245 "15/5/1930" ""
    2019 973 1 .3017654 .10713505 19.79473 "15/5/1930" ""
    2000 1394 1 -3.0845354 -.02237191 19.64642 "01-Ιανουάριος-1950" ""
    2001 1394 1 .5732579 .09029305 19.81431 "01-Ιανουάριος-1950" ""
    2002 1394 1 .3335664 .13597265 19.86958 "01-Ιανουάριος-1950" ""
    2003 1394 1 .33435085 .1652293 19.947145 "01-Ιανουάριος-1950" ""
    2004 1394 1 .3377546 .2320663 20.03664 "01-Ιανουάριος-1950" ""
    2005 1394 1 .3559843 .1945449 20.109186 "01-Ιανουάριος-1950" ""
    2006 1394 1 .1991756 .12997176 20.671274 "01-Ιανουάριος-1950" ""
    2007 1394 1 .269208 .10655569 20.66763 "01-Ιανουάριος-1950" ""
    2008 1394 1 .23378377 .11009266 20.668783 "01-Ιανουάριος-1950" ""
    2009 1394 1 .2185519 .10465521 20.6744 "01-Ιανουάριος-1950" ""
    2010 1394 1 .2416431 .05687732 20.699545 "01-Ιανουάριος-1950" ""
    2011 1394 1 0 -.022519477 20.60041 "01-Ιανουάριος-1950" ""
    2012 1394 1 0 -.05756895 20.5199 "01-Ιανουάριος-1950" ""
    2013 1394 1 0 -.13632222 20.29363 "01-Ιανουάριος-1950" ""
    2014 1394 1 0 -.2751217 20.10758 "01-Ιανουάριος-1950"

    ...

  • #2
    Johan:
    type -search synth- from within Stata.
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Johan:
      type -search synth- from within Stata.
      I looked for it but I didn't find a solution. The request is trunit() trperiod(). Since the treatment year is not a specific one but different

      Comment


      • #4
        replace start = subinstr(start, "Ιανουάριος", "Jan", .)
        replace start = subinstr(start, "Φεβρουάριος", "Feb", .)
        replace start = subinstr(start, "Μάρτιος", "Mar", .)
        replace start = subinstr(start, "Απρίλιος", "Apr", .)
        replace start = subinstr(start, "Μάιος", "May", .)
        replace start = subinstr(start, "Ιούνιος", "Jun", .)
        replace start = subinstr(start, "Ιούλιος", "Jul", .)
        replace start = subinstr(start, "Αύγουστος", "Aug", .)
        replace start = subinstr(start, "Σεπτέμβριος", "Sep", .)
        replace start = subinstr(start, "Οκτώβριος", "Oct", .)
        replace start = subinstr(start, "Νοέμβριος", "Nov", .)
        replace start = subinstr(start, "Δεκέμβριος", "Dec", .)
        gen date = date(start, "DMY")
        gen ipo = year(date)
        xtset firm_id econ_year
        gen pre_treatment = .
        by firm_id: replace pre_treatment = 1 if econ_year < ipo
        by firm_id: replace pre_treatment = 0 if econ_year >= ipo
        ssc install synth
        by firm_id: egen ROA_pre = ROA if pre_treatment == 1
        by firm_id: egen size_pre = SIZE_CONTROL if pre_treatment == 1
        levelsof firm_id if listed == 1, local(treated_companies)
        foreach treated_company in `treated_companies' {
        local start_year = `=ipo if firm_id == `treated_company''
        synth ETR ROA_pre size_pre ,trunit(`treated_company') trperiod(`start_year')

        I find this code but Ι am not sure about the trunit and trperiod
        Last edited by JOHAN JOHNYS; 28 Jul 2024, 02:19.

        Comment


        • #5
          Hey Johan, I'm the resident expert on SCM. I don't understand what the issue is, here. So, let me ask it like this.

          What is Stata doing that you don't want it to do? What is it not doing that you do want it to do? Or... what do you wish for it to do that you don't know if it can actually do?


          If you seem synthetic control methods for multiple treated units, then you seek either my command fdid (see my tutorial) or the allsynth command written by Justin Wiltshire.

          Comment


          • #6
            Try synth_runner from SSC. It can handle multiple treated units with staggered treatments.

            Comment


            • #7
              Dimitriy V. Masterov This is true, but in my experience anyways, synth_runner's syntax can be very very clunky, putting it mildly. Don't you need to define mini Stata programs just to handle staggered adoption? I remember that being in the help file/article (I could be completely mistaken about this, but I'm pretty sure this is true).

              Instead, allsynth requires no definition of additional programs for this instance, and to me is a lot more user friendly to people who don't know how to write their own ado code for a staggered adoption setting. Its syntax is a little clunky still, but I think it's much more intuitive than synth_runner.

              Again I could be wrong about all of this by the way, maybe the authors have updated it considerably since I last used it (many years ago now I guess), but in my recollection it wasn't the friendliest syntax I've ever used.

              Comment

              Working...
              X