Announcement

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

  • Question on Synthetic control method placebo test

    Hello Everyone!

    I'm running the synthetic control method on stata 13 and am trying to do the placebo tests based on Abadie et al "Synthetic Control Methods for Comparative Case Studies: Estimating the Effect of California’s Tobacco Control Program"

    I'm running the following code:
    . forval i=1/57{qui synth gdpgrowth gdp domcredit grosscapform fdigdp govcons tradeopen, trunit('i') trperiod (2009) keep(synth_'i
    > ', replace) }

    but I keep getting the following error: program error: code follows on the same line as open brace

    Can anyone help me out please?
    Thank you.
    Yehia

  • #2
    Stata already told you what is wrong:

    Code:
    forval i=1/57 {
         qui synth ...
    }
    Braces should be placed on separate lines.
    Last edited by Belinda Foster; 17 Jul 2016, 05:41. Reason: typo

    Comment


    • #3
      Thanks so much.

      Now I'm getting the error:

      treated unit not found in panelvar - check tr()
      r(198);

      after having inserted the above command on separate lines.
      Any ideas what that means?

      Thanks again!

      Comment


      • #4
        the local i should not be enclosed in regular single quote marks like you did 'i' but rather with a single quote mark on the right side and a "grave mark" (you can look it up) on the left side as such:
        `i'

        Comment


        • #5
          Dear Ariel,

          I have done that and I keep getting the same error.

          This is the code I'm using:
          Code:
          forval i=1/57{
          qui synth gdpgrowth gdp domcredit grosscapform fdigdp govcons tradeopen, trunit(`i') trperiod(2009) keep(synth_`i', replace)
          }
          Can you see where the problem is?

          Comment


          • #6
            did you tsset the data?

            Comment


            • #7
              Yes, I did

              Comment


              • #8
                This is very strange. unfortunately, this thread is the first time I have encountered the synth command and I tried to help by working with it's help file and examples and general stata knowledge... I regret to say that this is far as I can go, unless you can upload your data or a part of it via dataex (see the FAQ).

                Comment

                Working...
                X