Announcement

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

  • Graphs for Difference-in-Difference estimation

    I have a pooled cross-section dataset of 788 firms for the period of 2006-2017. There was an exogenous shock in 2009 to all my set of firms due to which some became treated and some remained untreated in the post-period. To find out the counterfactual sample in the pre-period for the treated group in the post-period, I have used propensity score matching methods. Thereafter, I have employed a difference-in-difference methodology to find the impact of the treatment on the outcome.
    Now, my objective is to show graphically the differential impact of the treatment on the outcome for the treated and control group in the pre-post period
    I am also attaching a graph from the paper I am following. I want to make a similar graph to show graphically the differential impact of the treatment in my study.
    Please help me on how to do it with Stata?
    Attached Files

  • #2
    Here is a basic example of how to do this, using the grunfeld sample dataset (and assuming a fake treatment that turns on for firms 1,2, and 3 in 1945).
    Code:
    webuse grunfeld, clear
    *fake treatment
    gen treated = inrange(company,1,3)
    gen post = year>=1945
    * basic DiD regression
    reg kstock i.treated##i.post 
    * now, make the graph
    collapse (mean) kstock, by(year treated)
    twoway (line kstock year if treated==1) (line kstock year if treated==0), xline(1945) legend(label(1 Treated) label(2 Control))
    Because you are selecting only certain firms as controls, you would want to limit your data to only the treated and matched control firms before collapsing to make the graph.

    Comment

    Working...
    X