Announcement

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

  • difference in difference graph

    Hi,

    I intend to produce a difference in difference graph of my data such as the graph give below;



    My data is here;

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int year byte(time treatment) float percentage
    2018 0 0 .28
    2020 1 0 .44
    2018 0 1 .27
    2020 1 1 .51
    end
    I have produced the following graph using the code below, but it is not the one that I want to present, and it does not have the dotted line.

    Code:

    Code:
    reshape wide percentage, i(time) j(treatment)
    graph twoway line percentage0 percentage1 year, ytitle(%) xtitle(year end) xline(2018.3) sort



    Could you guys help me out producing the graph with the dotted line above.
    Thanks

  • #2
    Duplicate post answered here https://www.statalist.org/forums/for...fference-graph

    Comment

    Working...
    X