Announcement

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

  • did_multiplegt help!

    Dear StataList-ers!
    Help! I need somebody!

    I am applying a DID in multiple treatment groups and multiple time periods. I examine the before-after effect of certain policy changes (prostitution liberalization and prohibition) on sexual crime in treatment countries compared to controls.
    I look at 2 subsamples – one consists of the countries that liberalized and the controls; the other one includes the countries that implemented a ban and the controls.
    For the sake of simplicity, I’ll focus on the “liberalizing” sample. The key independent variable “Liberalization” is an indicator variable, which takes the value of one beginning in the year when a country liberalizes its policy, and zero otherwise. The dependent variable, “Rape Rate” measures the number of rape cases per 100,000 population recorded at the national level. Country and years fixed effects are included and standard errors are clustered by country. The baseline regression is:

    Code:
    reg rape_rate prostitution_liberalization controls i.year i.country, robust cluster (country)
    To address the heterogeneity in the timing of treatment, I have also performed a bacon decomposition. However, the editor suggested that I implemented “something like Chaisemartin and co-authors.” I checked the relevant papers (de Chaisemartin, C and D'Haultfoeuille), and read the help for did_multiplegt. Following the examples, I am running:


    Code:
    did_multiplegt raperate_2 country year prostitution_liberalization, placebo(1) breps(50) cluster (country)
    
    ereturn list
    scalar t_stat = e(effect_0)/e(se_effect_0)
    scalar p_val = 2*normal(-abs(t_stat))
    
    di t_stat, p_val
    Outcome:
    Code:
        Estimate    SE    LB CI    UB CI    N    Switchers
                                
    Effect_0    -.3168059    .2562758    -.8191065    .1854947    143    8
    Placebo_1    .3024863    .5556721    -.786631    1.391604    142    8

    Is this correct? I am not certain if this is what I should be doing. Moreover, I am not sure how to interpret the result? Please, help!

    Here is also a data example:
    Code:
     * Example generated by -dataex-. To install: ssc install dataex clear input long country int year byte prostitution_liberalization double(ln_population unemploymentrate gdp_cap) 5 2006 0 13.519813537597656  4.533   27169.9925579717 5 2007 0 13.538328170776367    3.9   31386.6326506534 5 2008 0 13.562336921691895  3.642   35390.7048833763 5 2009 0 13.588521957397461  5.417   32105.8159000782 5 2010 0 13.616010665893555  6.292   30818.4639574235 5 2011 0 13.640860557556152  7.908   32233.8394246573 5 2012 0 13.667023658752441 11.883   28984.9148053503 5 2013 0 13.671499252319336 15.917   27942.3166728809 5 2014 0 13.662359237670898  16.17    27400.802986104 5 2015 0 13.649465560913086   14.9   23212.2247018375 5 2016 0 13.651012420654297   12.7                  . 5 2017 0 13.658625602722168   10.4                  . 6 1990 0  16.15366554260254    2.3 3917.1598401020415 6 1991 0 16.148101806640625    2.3 2878.7192830636873 6 1992 0  16.14887237548828    3.3  3352.034161446508 6 1993 0    16.150146484375    4.3 3931.7444627475675 6 1994 0 16.150951385498047    4.3  4601.952312486726 6 1995 0 16.150869369506836      4  5788.150736797088 6 1996 0  16.14972496032715    3.9 6493.8633464010845 6 1997 0 16.148540496826172    4.8 5996.8338104398235 6 1998 0  16.14756965637207  6.479  6458.904501044037 6 1999 0  16.14664649963379  8.756  6307.698003777906 6 2000 0 16.145524978637695  8.824  6011.615220357014 6 2001 0 16.141033172607422  8.166  6609.205529860541 6 2002 0  16.13801383972168  7.313  8032.896612457674 6 2003 0 16.137176513671875  7.812  9773.117502512805 6 2004 0 16.137441635131836  8.321 11685.887240723441 6 2005 0 16.137786865234375  7.927 13346.176389885748 6 2006 0 16.140207290649414  7.148 15183.636054137549 6 2007 0  16.14320182800293   5.32  18373.64899769132 6 2008 0   16.1518611907959  4.392 22698.853957260453 6 2009 0 16.159791946411133  6.662 19741.597627982617 6 2010 0  16.16326904296875  7.279 19808.071091251848 6 2011 0 16.165620803833008  6.711   21717.4579392202 6 2012 0 16.167404174804687  6.978  19729.87051117635 6 2013 0 16.168420791625977  6.953 19916.019387372155 6 2014 0 16.168067932128906    6.1   19744.5586092159 6 2015 0  16.17052459716797      5  17715.61685230089 6 2016 0   16.1716365814209    3.5                  . 6 2017 0 16.174476623535156    2.4                  . 7 1990 0 15.451669692993164  7.167  26891.44163993726 7 1991 0 15.453821182250977  7.867  27011.38589104921 7 1992 0  15.45685863494873  8.608 29569.654526163493 7 1993 0 15.460433959960938  9.533 27597.971483377994 7 1994 0 15.463522911071777  7.733 29995.565218950873 7 1995 0  15.46718692779541  6.758  35351.38070653458 7 1996 0 15.473934173583984  6.317  35650.72434200985 7 1997 0 15.478511810302734  5.242  32835.92876661025 7 1998 0 15.482247352600098  4.883   33368.1548509045 7 1999 1   15.4857759475708  5.108  33440.80162006377 7 2000 1 15.488865852355957  4.317 30743.559173584672 7 2001 1 15.492460250854492  4.508  30751.64946038433 7 2002 1 15.496031761169434  4.642  33228.69290871008 7 2003 1  15.49885082244873  5.433  40458.77064028385 7 2004 1 15.501472473144531  5.517  46511.60457103468 7 2005 1 15.504019737243652    4.8 48799.820370324735 7 2006 1  15.50698184967041    3.9  52026.99311241551 7 2007 1 15.510590553283691  3.767  58487.04501164047 7 2008 1 15.515847206115723  3.458  64322.06664415255 7 2009 1   15.5223388671875  5.992 58163.293594306815 7 2010 1 15.526555061340332  7.475  58041.41122456013 7 2011 1 15.531221389770508  7.567 61753.660072180384 7 2012 1 15.534791946411133  7.542  58507.50020962721 7 2013 1 15.538745880126953  7.008  61191.19262604284 7 2014 1 15.543128967285156  6.533  62548.98501743713 7 2015 1 15.548884391784668    6.2  53012.99658350081 7 2016 1 15.557204246520996    6.1                  . 7 2017 1 15.564536094665527    5.3                  . 8 1990 0   14.2669677734375     .6                  . 8 1991 0 14.265151023864746    1.5                  . 8 1992 0  14.25690746307373    3.7            6782.14 8 1993 0 14.228483200073242    6.5           6971.181 8 1994 0 14.205491065979004    7.6            7414.93 8 1995 0 14.185745239257812    9.7 3044.3837091107976 8 1996 0 14.169816970825195     10 3352.7337408889102 8 1997 0 14.156256675720215    9.6 3619.9454956801105 8 1998 0  14.14702320098877    9.8  4052.292270590271 8 1999 0 14.137041091918945   12.2  4119.347393908136 8 2000 0 14.152874946594238 14.602  4070.032826987136 8 2001 0 14.146769523620605 13.009  4498.957027431462 8 2002 0  14.14013385772705 11.227  5308.347780593283 8 2003 0 14.134102821350098 10.342  7174.237414733685 8 2004 0 14.127580642700195  10.14  8850.465114847913 8 2005 0 14.122149467468262  8.031 10338.313223579884 8 2006 0 14.116133689880371  5.912 12595.410648630354 8 2007 0 14.110357284545898  4.592  16586.40520488473 8 2008 0 14.107015609741211  5.455 18094.548052783066 8 2009 0 14.104995727539063 13.549 14726.318278058745 8 2010 0  14.10315990447998 16.707 14638.604817345657 8 2011 0 14.100434303283691 12.325  17454.84342464351 8 2012 0 14.097086906433105 10.023  17421.89022273776 8 2013 0 14.093274116516113  8.628 19072.238517566937 8 2014 0 14.089969635009766  7.013 19949.581376697068 8 2015 0 14.089248657226563    6.2  17155.87417599953 8 2016 0 14.090106964111328    6.4                  . 8 2017 0 14.090106964111328    5.7                  . 9 1990 0 15.419812202453613    3.2 28380.548911274975 9 1991 0 15.424644470214844  6.606 25503.215209010872 9 1992 0 15.430731773376465 11.725  22337.48712369123 9 1993 0 15.435884475708008 16.357 17617.030438665395 end label values country country label def country 5 "Cyprus", modify label def country 6 "CzechRepublic", modify label def country 7 "Denmark", modify label def country 8 "Estonia", modify label def country 9 "Finland", modify

    Thank You in advance!

  • #2
    You didn't format your data example properly, but I used this command for my masters thesis.

    Clement and Xavier's command works well here. Be sure you really read through the papers to know if it's what you really want- it was tough for me, but I haven't had courses in discrete math and the usual real analysis that econometricians to through.

    Anyhow, what you're looking at here is the ATT in the first policy period, and we also see placebo estimates for the first pre intervention time period.


    Either way, your output seems a little unusual. How many treated units are there? How many pre and post intervention time periods are there? You seem to only have one pre policy and one period where the policy begins...........

    Comment

    Working...
    X