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:
I have included a separate table to address the small number of clusters (using wild cluster bootstrapping).
However, the editor requests to “update your standard errors to reflect few clusters not just in one robustness table but in all relevant tables. This will entail your presenting this as your default method of standard-error computation when you discuss methods.”
How to do this? Thank you – much appreciated!
Here is also a data example:
Best,
Vanya
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)
Code:
reg raperate_2 prostitution_liberalization ln_gdp ln_population unemploymentrate Womenper100men police_population migrant_population GII i.year i.country, robust cluster(country) boottest prostitution_liberalization boottest prostitution_liberalization, nonull boottest prostitution_liberalization, bootcluster (country year) boottest prostitution_liberalization, nonull bootcluster (country year)
How to do this? Thank you – much appreciated!
Here is also a data example:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long country int year double raperate_2 byte prostitution_liberalization double(ln_gdp ln_population unemploymentrate) 5 2006 0 0 10.209868431091309 13.519813537597656 4.533 5 2007 2.475989777 0 10.354137420654297 13.538328170776367 3.9 5 2008 0 0 10.474204063415527 13.562336921691895 3.642 5 2009 0 0 10.376792907714844 13.588521957397461 5.417 5 2010 3.3 0 10.335868835449219 13.616010665893555 6.292 5 2011 3.4 0 10.38077163696289 13.640860557556152 7.908 5 2012 2.2 0 10.274530410766602 13.667023658752441 11.883 5 2013 1.6 0 10.237897872924805 13.671499252319336 15.917 5 2014 1.2 0 10.218327522277832 13.662359237670898 16.17 5 2015 1.7 0 10.052433967590332 13.649465560913086 14.9 5 2016 2.59 0 10.0718355178833 13.651012420654297 12.7 5 2017 2.3399999141693115 0 10.135930061340332 13.658625602722168 10.4 6 1990 8.6 0 8.27312183380127 16.15366554260254 2.3 6 1991 7.4 0 7.9651007652282715 16.148101806640625 2.3 6 1992 6.9 0 8.11732292175293 16.14887237548828 3.3 6 1993 7.4 0 8.276838302612305 16.150146484375 4.3 6 1994 7.1 0 8.434235572814941 16.150951385498047 4.3 6 1995 7.03 0 8.663568496704102 16.150869369506836 4 6 1996 6.57 0 8.778613090515137 16.14972496032715 3.9 6 1997 6.36 0 8.698987007141113 16.148540496826172 4.8 6 1998 6.553398058252427 0 8.773215293884277 16.14756965637207 6.479 6 1999 6.155339805825243 0 8.749526023864746 16.14664649963379 8.756 6 2000 4.8543689320388355 0 8.701448440551758 16.145524978637695 8.824 6 2001 5.496870109546166 0 8.796218872070313 16.141033172607422 8.166 6 2002 6.401333202627194 0 8.991300582885742 16.13801383972168 7.313 6 2003 6.333751237 0 9.187390327453613 16.137176513671875 7.812 6 2004 6.734194859 0 9.366137504577637 16.137441635131836 8.321 6 2005 5.831338513 0 9.498985290527344 16.137786865234375 7.927 6 2006 5.166298267 0 9.627973556518555 16.140207290649414 7.148 6 2007 6.176355805 0 9.818673133850098 16.14320182800293 5.32 6 2008 5.097636113 0 10.030069351196289 16.1518611907959 4.392 6 2009 4.597817856 0 9.890482902526856 16.159791946411133 6.662 6 2010 5.3 0 9.893844604492188 16.16326904296875 7.279 6 2011 6.09 0 9.985871315002441 16.165620803833008 6.711 6 2012 6.06 0 9.889888763427734 16.167404174804687 6.978 6 2013 5.67 0 9.899279594421387 16.168420791625977 6.953 6 2014 6.43 0 9.890633583068848 16.168067932128906 6.1 6 2015 5.56 0 9.782201766967773 16.17052459716797 5 6 2016 6.15 0 9.82464599609375 16.1716365814209 3.5 6 2017 5.650000095367432 0 9.921727180480957 16.174476623535156 2.4 7 1990 9.5 0 10.199563026428223 15.451669692993164 7.167 7 1991 10.3 0 10.20401382446289 15.453821182250977 7.867 7 1992 10.8 0 10.294504165649414 15.45685863494873 8.608 7 1993 9.6 0 10.225497245788574 15.460433959960938 9.533 7 1994 9.2 0 10.308804512023926 15.463522911071777 7.733 7 1995 8.42 0 10.473093032836914 15.46718692779541 6.758 7 1996 7.37 0 10.481524467468262 15.473934173583984 6.317 7 1997 8.23 0 10.39927864074707 15.478511810302734 5.242 7 1998 7.885304659498208 0 10.41535758972168 15.482247352600098 4.883 7 1999 8.967851099830796 1 10.417531967163086 15.4857759475708 5.108 7 2000 9.31409295352324 1 10.333436012268066 15.488865852355957 4.317 7 2001 9.199477514461654 1 10.333699226379395 15.492460250854492 4.508 7 2002 9.304056568663938 1 10.411169052124023 15.496031761169434 4.642 7 2003 8.76592329 1 10.608038902282715 15.49885082244873 5.433 7 2004 10.40686779 1 10.747457504272461 15.501472473144531 5.517 7 2005 8.764736752 1 10.79548168182373 15.504019737243652 4.8 7 2006 9.682793877 1 10.859518051147461 15.50698184967041 3.9 7 2007 8.995946339 1 10.976560592651367 15.510590553283691 3.767 7 2008 7.203520557 1 11.07165813446045 15.515847206115723 3.458 7 2009 6.371186022 1 10.971010208129883 15.5223388671875 5.992 7 2010 16.37 1 10.968912124633789 15.526555061340332 7.475 7 2011 15.09 1 11.030908584594727 15.531221389770508 7.567 7 2012 14.64 1 10.976910591125488 15.534791946411133 7.542 7 2013 14.05 1 11.021758079528809 15.538745880126953 7.008 7 2014 13.99 1 11.043704986572266 15.543128967285156 6.533 7 2015 16.54 1 10.878292083740234 15.548884391784668 6.2 7 2016 29.42 1 10.888908386230469 15.557204246520996 6.1 7 2017 31.360000610351563 1 10.938583374023438 15.564536094665527 5.3 8 1990 3.4 0 8.141772270202637 14.2669677734375 .6 8 1991 3.9 0 8.184234619140625 14.265151023864746 1.5 8 1992 4.7 0 8.82204818725586 14.25690746307373 3.7 8 1993 6.9 0 8.849539756774902 14.228483200073242 6.5 8 1994 8.3 0 8.911251068115234 14.205491065979004 7.6 8 1995 6.87 0 8.021053314208984 14.185745239257812 9.7 8 1996 6.41 0 8.117531776428223 14.169816970825195 10 8 1997 6.65 0 8.1942138671875 14.156256675720215 9.6 8 1998 3.76947860287476 0 8.307038307189941 14.14702320098877 9.8 8 1999 4.2547974644291715 0 8.323450088500977 14.137041091918945 12.2 8 2000 5.332359386413441 0 8.311406135559082 14.152874946594238 14.602 8 2001 5.5 0 8.411601066589356 14.146769523620605 13.009 8 2002 6.56 0 8.577035903930664 14.14013385772705 11.227 8 2003 7.914464609 0 8.878252029418945 14.134102821350098 10.342 8 2004 8.973272256 0 9.088225364685059 14.127580642700195 10.14 8 2005 13.30007571 0 9.243612289428711 14.122149467468262 8.031 8 2006 11.38360671 0 9.44108772277832 14.116133689880371 5.912 8 2007 9.084999103 0 9.716339111328125 14.110357284545898 4.592 8 2008 11.92121567 0 9.803365707397461 14.107015609741211 5.455 8 2009 9.242495504 0 9.597391128540039 14.104995727539063 13.549 8 2010 6.03963792 0 9.59141731262207 14.10315990447998 16.707 8 2011 6.9 0 9.767372131347656 14.100434303283691 12.325 8 2012 10.8 0 9.765482902526856 14.097086906433105 10.023 8 2013 10.2 0 9.855989456176758 14.093274116516113 8.628 8 2014 11.2 0 9.90096378326416 14.089969635009766 7.013 8 2015 12.3 0 9.750096321105957 14.089248657226563 6.2 8 2016 11.55 0 9.78339672088623 14.090106964111328 6.4 8 2017 11.399999618530273 0 9.88861083984375 14.090106964111328 5.7 9 1990 7.6 0 10.253458976745605 15.419812202453613 3.2 9 1991 7.5 0 10.146559715270996 15.424644470214844 6.606 9 1992 7.3 0 10.014021873474121 15.430731773376465 11.725 9 1993 7.2 0 9.77662181854248 15.435884475708008 16.357 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
Best,
Vanya
Comment