Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Ariel Linden, DrPH" <ariel.linden@gmail.com> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | re: st: Synth (Abadia, Diamond, and Hainmueller) Placebo test graphic |
Date | Thu, 12 Sep 2013 11:19:09 -0400 |
Charlotte, When posting a question about a particular program, you need to indicate where you got it from. In this case, -synth- can be currently downloaded from http://www.mit.edu/~jhainm/Synth (Jens Hainmueller is now at MIT, but was at Harvard when he originally wrote this program. So all recent updates are found on his site). As for your problem, it can be solved by adding in the -keep- option to the end of the command (see below). This will generate a new output file after each loop, with the annual values you are requestion. More specifically, you need the following three fields: _Y_treated _Y_synthetic _time After running the loop, I would merge the 4 files together (using the _time variable as the anchor for the merge) so that you can plot the values for each iteration. This is pretty straightforward. I hope this helps Ariel **** code ***** tempname resmat forvalues i = 1/4 { synth cigsale retprice cigsale(1988) cigsale(1980) cigsale(1975) , trunit(`i') trperiod(1989) xperiod(1980(1)1988) keep(test`i') matrix `resmat' = nullmat(`resmat') \ e(RMSPE) local names `"`names' `"`i'"'"' } mat colnames `resmat' = "RMSPE" mat rownames `resmat' = `names' matlist `resmat' , row("Treated Unit") ****end code**** Date: Wed, 11 Sep 2013 14:37:08 +0200 From: Charlotte Timmermans <timmermanscharlotte@gmail.com> Subject: st: Synth (Abadia, Diamond, and Hainmueller) Placebo test graphic Hello, I am using the synthetic control method as developed by Abadie, Diamond and Hainmueller with Stata 12. I ran the method and got the results for my treated country (The Congo) and for its synthetic counterpart made from a pool of 21 potential comparison countries. I am now willing to implement the placebo test to verify the significance of my results. Following the synth help page provided by stata, I introduced the following commands: tempname resmat forvalues i =3D 1/21 { synth rgdpch2 ini_gdp ci LifeexpectancyBirth2 Populationgrowthannual av_pretreatment_gdp , trunit(`i') trperiod(1965) matrix `resmat' =3D nullmat(`resmat') \ e(RMSPE) local names `"`names' `"`i'"'"' } mat colnames `resmat' =3D "RMSPE" mat rownames `resmat' =3D `names' matlist `resmat' , row("Treated Unit") The program applied the SCM to every country in the donnor pool and got the graph with the RMSPEs I need to compute the graphic that computes the estimated effect associated with every placebo run. ( A graph that shows the differences between per capita GDP paths (my outcome variable) in every one of the 21 countries and their synthetic counterpart. ) For example, in Abadie, Diamond and Hainmueller's paper about the Effect of California=92sTobacco Control Program, shows the graph that computes the placebo tests. How should I proceed in Stata12 to compute this graphic? I am unable to find the right comands. Thank you for your time, Best Regards. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/