Announcement

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

  • Synth / Synth_runner command; How to graph unit weights and outcome difference?

    Dear all,

    I read the paper 'Synthetic Difference in Differences' by Arkhangelsky et. al. (2021), and applaud their way of presenting unit weights and outcome differences in one, which is shown on p. 11, Figure 1. Does anyone know how to replicate this for the synth and a DiD function as it is already incorporated when running the sdid command?
    I added a picture for clarification.
    Best,
    Emil

    Last edited by Emil Nordentoft; 15 Feb 2023, 07:54.

  • #2
    .
    Attached Files

    Comment


    • #3
      I mean I can do this, but..... did you read this? https://arxiv.org/abs/2301.11859

      Comment


      • #4
        Dear Jared,
        Thanks for sharing!
        I already went through the paper, but it seems that my bug was that I had installed both the 'ssc install sdid' and the web version 'net install sdid, from("https://raw.githubusercontent.com/daniel-pailanir/sdid/master")', which apparently bugged the subcommand method(did) and method(sc), for which I have no idea. Thanks for the quick reply though!

        Best,
        Emil

        Comment


        • #5
          Hi Emil and Jared

          I'm also having trouble getting the sdid graph option to work, possibly the same problem you faced? I get the error message invalid '(' with both the ssc and the github versions of sdid, and removing the seed and reps options don't change the error either. You can see from the below that the sdid works fine, but when I try to run it with the graph option I get the error:

          . sdid LOS_log Group_ID Calendar_Timevar Treated, vce(bootstrap) seed(123456) reps(5) graph
          Bootstrap replications (5). This may take some time.
          ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
          .....

          Synthetic Difference-in-Differences Estimator

          -----------------------------------------------------------------------------
          LOS_log | ATT Std. Err. t P>|t| [95% Conf. Interval]
          -------------+---------------------------------------------------------------
          Treated | -0.05241 0.01882 -2.79 0.005 -0.08929 -0.01553
          -----------------------------------------------------------------------------
          95% CIs and p-values are based on Large-Sample approximations.
          Refer to Arkhangelsky et al., (2020) for theoretical derivations.
          invalid '('
          r(198);

          I have updated the version of Stata to the latest, and uninstalled and reinstalled sdid (both ssc and github), and nothing changes.

          Is this the same problem you had, and did you find a solution?

          Thanks

          Andrew

          Comment


          • #6
            Dear Andrew,
            It seems as if your command is working whereas you run into a problem once you are to save or create the output.
            Try to add the following delimit codes and delete the graph command. Thereafter you can subsequently try to add the graphs one at a time in line the SDID stata paper that Jared linked to.
            #delimit
            sdid ...
            #delimit cr

            Best

            Comment


            • #7
              Thanks Emil

              Yes, the model runs, it's just something with the graph option that's causing the error.

              I tried your idea to change the delimiter and it still gave the same error. I also tried the examples straight from the paper without changing the delimiter:

              webuse set www.damianclarke.net/stata/
              webuse prop99_example.dta, clear
              sdid packspercapita state year treated, vce(placebo) seed(1213) graph

              and then with changing the delimiter:

              #delimit
              sdid packspercapita state year treated, vce(placebo) seed(1213) graph;
              #delimit cr;

              but they all gave the same error of:

              invalid '('

              I also tried (with and without setting the delimiter):

              sdid packspercapita state year treated, vce(placebo) seed(1213) graph g1on g2_opt(ylabel(0(25)150) ytitle("Packs per capita") scheme(sj)) g1_opt(xtitle("") scheme(sj)) graph_export(sdid_, .eps)

              But still gave the same error.

              Any more ideas very very welcome!

              Thanks

              Andrew

              Comment

              Working...
              X