Announcement

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

  • Stata Command for Graphing placebo test results

    Hi Everyone,

    I am trying to replicate the synthetic control method implemented by Abadie,Diamond, and Hainmueller.
    I am using the following commands:


    use "synth_smoking.dta"

    tsset state year


    synth cigsale beer lnincome retprice age15to24 cigsale(1988) cigsale(1980) cigsale(1975), trunit(3) trperiod(1989) xperiod(1980(1)1988) nested



    Later I do placebo test using the following command:

    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")


    and I get the results but I do not know how to plot the results. Could anyone help me with plotting the results of the placebo test in a single graph?

    I am not a native English speaker and also am new to Stata and econometrics; I am sorry if I used wrong terminology.

    Thank you very much!



  • #2
    Hi George,
    Welcome to Statalist. You'll increase your chances of a useful answer by following the FAQ on asking questions - provide Stata code in code delimiters. Being able to replicate your problem can be essential to helping you.

    Do you use the "keep" option in your command?
    [CODE synth , trunit() trperiod() resultsperiod() mspeperiod() keep(Results.dta)[/CODE]

    Then you can just use this file
    Code:
    use Results.dta, clear
     tsset _time
    twoway (tsline _Y_treated _Y_synthetic), ti("INSERT TITLE") xline(YEAR OF THE EVENT, lpattern(dash) lc(gs7)) graphregion(color(white))

    Mattia



    Comment

    Working...
    X