Announcement

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

  • Synth: Pre/post MSPE

    Dear all

    I have problem calculating the Post(event)-MSPE in the placebo analysis.

    I am student at the Norwegian School of Economics and I am writing my master thesis using the synthetic control method testing the effect of partial privatization. I am running the synthetic control method on Stata/IC 14 using the codes provided by the authors (website:http://web.stanford.edu/~jhain/synthpage.html) and the help synth command in Stata. I am however unable to calculate the Post/pre MSPE-ratio.

    The help synth command provide me with a code for the pre-event MSPE, but I do not know how to modify the formula to calcutale the POST-event MSPE.

    . tempname resmat
    forvalues i = 1/4 {
    synth cigsale retprice cigsale(1988) cigsale(1980) cigsale(1975) ,trunit(`i') trperiod(1989) xperiod(1980(1)1988)
    matrix `resmat' = nullmat(`resmat') \ e(RMSPE)
    local names `"`names' `"`i'"'"'}
    mat colnames `resmat' = "RMSPE"
    mat rownames `resmat' = `names'
    matlist `resmat' , row("Treated Unit")


    I do not expect anything, but it is possible to get some advice and help with Stata.


    I am referring to the final test in the paper:

    "One final way to evaluate the California gap relative to the gaps obtained from the
    placebo runs is to look at the distribution of the ratios of post/pre-Proposition 99 MSPE.
    The main advantage of looking at ratios is that it obviates choosing a cuto® for the exclusion
    of ill-fitting placebo runs. Figure 8 displays the distribution of the post/pre-Proposition 99
    ratios of the MSPE for California and all 38 control states. The ratio for California clearly
    stands out in the ¯gure: post-Proposition 99 MSPE is about 130 times the MSPE for the
    pre-Proposition 99 period. No control state achieves such a large ratio. If one were to assign
    the intervention at random in the data, the probability of obtaining a post/pre-Proposition
    99 MSPE ratio as large as California's is 1=39 = 0:026."

    Best regards, Thomas Kringlebu
    Last edited by Thomas Kringlebu; 16 Oct 2015, 03:53.

  • #2
    this was also sent to me as a private message - please do not do that - if I have a response, and time to make it, I will

    Comment


    • #3
      I apologize for the private meassage, I did not know better. I hope you find time to answer my question.

      Comment


      • #4
        Hi, I found a way to calculate the POST-event MSPE. But it is kind of slow.
        1.use synth command and and use keep to keep the data of estimation:

        synth rate rate(1) rate(2) rate(3) rate(4) rate(5) rate(6) rate(7), trunit(101) trperiod(8)xperiod(1(1)7) nested fig keep(nameyoulike)

        then Stata will create a nameyoulike.dta, which contains the real outcome and Synthetic outcome of treated observation.

        2.then open the file nameyoulike.dta, and calculate the post RMSPE in this way:

        use nameyoulike.dta, clear
        gen effect= _Y_treated - _Y_synthetic
        gen e2= effect^2
        sum e2 if _time==8 | _time==9

        (8 and 9 are post event period in this case)

        then you could copy the value to the excel and calculate the ratio of RMSPE post/pre treatment.

        for loop is kind of useful in this case(foreach)

        Comment


        • #5
          hi! this thread is extremely useful for my research paper right now. However, does anyone know what the last line of command means? its the "sum e2 if _time==8 | _time==9" to calculate post RMSPE. It does not work on my dataset.

          Would appreciate the help! Thanks!

          Comment


          • #6
            Tomorrow, when I wake up, I'll go over how to calculate the T1 RMSPE.

            Comment

            Working...
            X