Announcement

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

  • Graph parallel trend for DID with multiple periods and csdid

    Hi everyone,

    I am trying to do DID with multiple periods.

    My dataset is a panel data (from 1960 to 1980) and contains:

    - outcome variable ("aue_total_ha")
    - geographical scale of my study is local government areas ("lgacodes").
    - "dummy_general" that receives the value of 1 in the year that that local government area was treated and 0 if it is not yet treated.
    - "treat" that receives the value of 1 if that local government area was ever treated (doesn't matter the year) and 0 if those local government areas was never treated
    "first_treat" receives the year (e.g. 1973) that that local government area was first treated, and zero for local government areas that were never treated.
    - I also have a climate variable ("sum_precipitation")

    My questions are: how do I make a graph and test for parallel trend? Currently I am using:

    // Graph

    lgraph aue_total_ha year, by(treat),, legend(order(1 "Controls" 2 "Treated") size(small) )

    but I would like to control for "sum_precipitation". Is that possible?

    // Test parallel trend and DID

    csdid aue_total_ha sum_prec, ivar(lgacodes) time (year) gvar(first_treat) method(drimp)

    estat pretend


    Is there any other way to test for parallel trend? Am I applying csdid command correctly?

    Many thanks,

  • #2
    You are applying csdid correctly
    for parallel test, you could do
    csdid event, and discuss the effects before Tp0

    Or, you could also do
    csdid event, window(-10 -1)
    if you ONLY want to see the effects before the event.

    HTH

    Comment


    • #3
      Hi FernandoRios or any other expert, could you please help me with the code?

      I am running 4 models using csdid. I want to create a single image that contains the event study for each of the models. However, I wanted to show the event study only from window (-4 4). I believe the step would be creating something like this:

      // create the four plots
      csdid_plot, title("Event-Study dung beetle introduction - model 1") window(-4 4)
      csdid_plot, title("Event-Study dung beetle introduction - model 2") window(-4 4)
      csdid_plot, title("Event-Study dung beetle introduction - model 3") window(-4 4)
      csdid_plot, title("Event-Study dung beetle introduction - model 4") window(-4 4)

      // save the four plots

      ???

      // combine the four plots into a single image

      ???

      Many thanks!

      Comment

      Working...
      X