For my paper, I am looking to do a three period Difference in Difference Analysis of electoral outcomes on crime. My three periods are represented by the variable time_period which takes on the options of "pre_election", "election" and "post_election". My treated and control groups are represented by the variable treated which takes on the value 0 or 1. The complication arises from the fact that my treatement period is my election time period and my control periods are both pre and post election.
I am confused about how exactly to go about this. I tried using didregress but I think that doesn't work with 3 time periods. Before running a regression however, I want to plot a graph with two lines for the treated and control groups and two vertical lines so three vertical divisions across my x axis for my graph.
Any help is appreciated!
This is my first time using statalist so I hope my coding re the data is fine.
.
I am confused about how exactly to go about this. I tried using didregress but I think that doesn't work with 3 time periods. Before running a regression however, I want to plot a graph with two lines for the treated and control groups and two vertical lines so three vertical divisions across my x axis for my graph.
Any help is appreciated!
This is my first time using statalist so I hope my coding re the data is fine.
Code:
input str18 District str44 PS float(Year sec188_ps_quarter_1000k treated) str13 time_period float quarter "CENTRAL" "KAMLA MARKET" 2017 74.312485 0 "election" 2 "OUTER NORTH" "BHALSWA DAIRY" 2017 12.92194 1 "post_election" 3 "NORTH" "SARAI ROHILLA" 2017 0 1 "election" 2 "SOUTH EAST" "SARITA VIHAR" 2017 0 0 "post_election" 4 "EAST" "LAXMI NAGAR" 2017 0 0 "election" 2 "EAST" "PANDAV NAGAR" 2016 41.60357 0 "pre_election" 2 "WEST" "VIKASPURI" 2019 82.23737 1 "" 1 "SOUTH WEST" "INDER PURI" 2016 9.841681 0 "election" 4 "CENTRAL" "ANAND PARBAT" 2018 0 0 "" 3 "SHAHDARA" "FARASH BAZAR" 2018 80.444 0 "" 3 "NORTH EAST" "KARAWAL NAGAR" 2018 25.534346 0 "post_election" 1 "CENTRAL" "JAMA MASJID" 2018 0 0 "" 2 "NORTH WEST" "MUKHERJEE NAGAR" 2017 324.8565 0 "post_election" 3 "EAST" "ANAND VIHAR" 2016 0 0 "election" 4 "SHAHDARA" "G.T.B.ENCLAVE" 2019 42.43609 0 "" 2 "SHAHDARA" "GANDHI NAGAR" 2017 0 0 "election" 1 "OUTER NORTH" "BAWANA" 2017 45.44059 0 "election" 1 "SOUTH" "GREATER KAILASH" 2018 292.96277 0 "" 3 "NORTH EAST" "JYOTI NAGAR" 2017 77.86678 1 "election" 1 "OUTER DISTRICT" "MUNDKA" 2019 15.842152 1 "" 2 end
.
Comment