Solomon Negash
  • Selam!
  • Books
  • Codes
  • About
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu

Re: Synthetic Control Method

Re: Synthetic Control Method (Abadie et al. 2010)

Link to the original paper here.

--------------------------------------------------------------------------------------
      name:  
       log:  ~\myReplications\synthetic-control\synthdid.smcl
  log type:  smcl
 opened on:  16 Dec 2018, 18:24:07

*** Replication of Synthetic Control method - the last graphs 4-7

*** 1. Load dataset, tsset and loop through all units and store the results of synth using the keep option.

. sysuse smoking, clear
(Tobacco Sales in 39 US States)
. tsset state year
       panel variable:  state (strongly balanced)
        time variable:  year, 1970 to 2000
                delta:  1 unit
. forval i=1/39{
    qui synth cigsale retprice cigsale(1988) cigsale(1980) cigsale(1975), ///
    xperiod(1980(1)1988) trunit(`i') trperiod(1989) keep(synth_`i', replace)
    }

*** 2.  Quitely loop through all saved datasets and create the relevant variables (years and treatment effects). Drop missing observations.

. qui forval i=1/39{
   use synth_`i', clear
   rename _time years
   gen tr_effect_`i' = _Y_treated - _Y_synthetic
   keep years tr_effect_`i'
   drop if missing(years)
   save synth_`i', replace
 }

*** 3. Load the first dataset from step 2 and merge with the rest of datasets.
. use synth_1, clear
(Tobacco Sales in 39 US States)
. forval i=2/39{
    qui merge 1:1 year using synth_`i', nogenerate
    label var tr_effect_`i' "tr_effect_`i'" 
  }

** Rename tr_effect_i to tte_j by ranking based on MSPE scores. 

. qui rename tr_effect_17 tte_1
.	(...)

*** 4. Plot 
**Figure 4 (38 control states)
. set scheme s1mono 
. local lp
. forval i=1/38 {
    local lp `lp' line tte_`i' years, lcolor(gs12) || }
  twoway `lp' || line tte_3 years, lcolor(black) lwidth(medium) text(-40 1984 "Passage of Proposition 99 --->", size(*0.75)) ///
   legend(off) yline(0, lcolor(black) lwidth(thick) lpattern(dash)) xline(1989, lwidth(medium) lpattern(dash)) ///
   caption(Re: Figure 4. Per-cap cig sales gaps in California & placebo gaps in 38 control states.)

. graph export synth38.png, replace
(file synth38.png written in PNG format)
* 


**Figure 5 (34 control states)

. drop tte_35 tte_36 tte_37 tte_38 tte_39 
. local lp
. forval i=1/34 {
      local lp `lp' line tte_`i' years, lcolor(gs12) || 
   }
. twoway `lp' || line tte_3 years, lcolor(black) lwidth(medium) text(-40 1984 "Passage of Proposition 99 --->", size(*0.75)) ///
   legend(off) yline(0, lcolor(black) lwidth(thick) lpattern(dash)) xline(1989, lwidth(medium) lpattern(dash)) ///
   caption(Re: Figure 5. Per-cap cig sales gaps in California & placebo gaps in 34 control states)

. graph export synth34.png, replace
(file synth34.png written in PNG format)
* 


**Figure 6 (29 control states)

. drop tte_30 tte_31 tte_32 tte_33 tte_34
. local lp
. forval i=1/29 {
      local lp `lp' line tte_`i' years, lcolor(gs12) || 
  }
. twoway `lp' || line tte_3 years, lcolor(black) lwidth(medium) text(-40 1984 "Passage of Proposition 99 --->", size(*0.75)) ///
   legend(off) yline(0, lcolor(black) lwidth(thick) lpattern(dash)) xline(1989, lwidth(medium) lpattern(dash)) ///
   caption(Re: Figure 6. Per-cap cig sales gaps in California & placebo gaps in 29 control states)
. graph export synth30.png, replace
(file synth30.png written in PNG format)
 * 


**Figure 7 (19 control states)

. drop tte_20 tte_21 tte_22 tte_25 tte_23 tte_24 tte_26 tte_27 tte_28
. local lp
. forval i=1/19 {
      local lp `lp' line tte_`i' years, lcolor(gs12) || 
   }
. twoway `lp' || line tte_3 years, lcolor(black) lwidth(medium) text(-40 1984 "Passage of Proposition 99 --->", size(*0.75)) ///
   legend(off) yline(0, lcolor(black) lwidth(thick) lpattern(dash)) xline(1989, lwidth(medium) lpattern(dash)) ///
   caption(Re: Figure 7. Per-cap cig sales gaps in California & placebo gaps in 19 control states)
. graph export synth19.png, replace
(file synth19.png written in PNG format)
** 


. log close 
      name:  
       log:  ~\myReplications\synthetic-control\synthdid.smcl
  log type:  smcl
 closed on:  16 Dec 2018, 18:24:21
--------------------------------------------------------------------------------------




Popular
  • From Oslo to The Hague – The journey of Abiy Ahmed...November 7, 2020 - 3:06 pm
  • Reads Atlas Shrugged
    My top reads of 2023December 31, 2023 - 3:40 pm
  • የትግራይ ህዝብ እና የህውሓት ግኑኝነት...September 29, 2016 - 12:30 am
  • ጸበባን ቃልሲን ህዝቢ ትግራይ ከመይ...January 26, 2021 - 1:36 pm
  • ከምጽዓተ ኢትዮጵያ እንተርፍ ይሆን?...December 29, 2023 - 7:29 pm
  • Wooldridge chapter 4 – ExamplesJanuary 6, 2019 - 11:30 pm
  • IPIS Briefing March 2021 – Ethiopia-Tigray ConflictApril 10, 2021 - 7:03 pm
  • Spatial Mapping of Education DataDecember 24, 2018 - 12:01 am
  • ሶስቱ የጥፋት ፈረሶችና የኢትዮጵያ...November 12, 2020 - 5:48 pm
  • ትርጉም የለሽ ምጥ የለም!November 30, 2020 - 8:35 pm
  • መንግስት እና የህዝብ አስተዳደር –...March 5, 2017 - 2:19 am
  • በአዲስ አበባና በሌሎች ከተሞች የሚታዩ...February 8, 2019 - 3:23 pm
Recent
  • ጽምዶMarch 31, 2026 - 8:18 pm
  • ክሪቶ በፕላቶMarch 28, 2026 - 11:37 pm
  • ፍራንከንስታይን፥ አዲስ መፅሓፍ በገበያ...February 18, 2026 - 6:15 pm
  • My Top Reads of 2025December 15, 2025 - 4:31 pm
  • ሓንሳዕ ንደማመፅ እሞ!!October 18, 2025 - 6:16 pm
  • Great Ideas E04. Liberation, Then ReflectionOctober 10, 2025 - 6:54 pm
  • Great Ideas E03 – The Median Isn’t the MessageOctober 3, 2025 - 3:16 pm
  • ሃቅ ሃቁን ብቻ እናውራ ከተባለ ̷...October 1, 2025 - 11:55 pm
  • Great Ideas E02 – Great Scientific Ideas That Changed...September 26, 2025 - 1:30 pm
  • Great Ideas E01 – I, PencilSeptember 20, 2025 - 2:53 pm
  • My Replication Codes Project Gains Wider RecognitionSeptember 11, 2025 - 7:02 pm
  • Free GIS & Remote‑Sensing Toolkit 🌍April 18, 2025 - 9:18 pm
Comments
  • NATNAEL ENDALAMAW DERSHEየገብረህወት ባይከዳኝ መጥሃፍ መንግስት...November 20, 2025 - 5:40 pm by NATNAEL ENDALAMAW DERSHE
  • ሙለርትኽክል አለኻ ፀላኢኻን ፈታዊኻን ፈሊኻ...October 19, 2025 - 8:06 am by ሙለር
  • AwetThis is a very reflective essay about Tigray’s political...October 18, 2025 - 9:13 pm by Awet
  • Solomonሰላም ደረጀ ጽሁፉን እንዴት ማግኘት...April 19, 2025 - 8:32 pm by Solomon
  • ደረጀሶል የዶ/ር ተወልደ አርቲክል በሶፍት...April 19, 2025 - 7:35 pm by ደረጀ
  • Solomonእንኳዕ ሓቢሩ አብጽሓና!January 2, 2024 - 3:13 pm by Solomon
  • Solomonእንኳን አብሮ አደረሰን Babi!January 2, 2024 - 3:13 pm by Solomon
  • SolomonThank you Chombe, I wish you the same!January 2, 2024 - 3:12 pm by Solomon
  • Solomonአሰስ ብትል አንዳንዶቹን ኦንላይን...January 2, 2024 - 3:11 pm by Solomon
  • Brehaneእንኳዕ አብፅሓካ ሰሌ!January 2, 2024 - 2:46 am by Brehane
  • Babiሶል እንኳን አደረሰህ!January 1, 2024 - 7:34 am by Babi
  • ChombeThank you! All the best for 2024!December 31, 2023 - 9:03 pm by Chombe
©2026 - Solomon Negash
  • Home
  • Cons.Book
  • EthioData
  • Feeds
  • Contact
Link to: ሙስና ፣ ነጻ ገበያና ቼክ ኤንድ ባላንስ Link to: ሙስና ፣ ነጻ ገበያና ቼክ ኤንድ ባላንስ ሙስና ፣ ነጻ ገበያና ቼክ ኤንድ ባላንስ Link to: Spatial Mapping of Education Data Link to: Spatial Mapping of Education Data Spatial Mapping of Education Data
Scroll to top Scroll to top Scroll to top