Treatment Adoption Heatmap (Event Studies)
In lecture we visualized the Castle Doctrine’s staggered rollout with a heatmap. Now create one for STRV seed adoption in panel_gis.dta.
- Create the binary treatment indicator
post_adoptfrom thefirst_seedvariable you built in Exercise 4:gen post_adopt = (year >= first_seed) & (first_seed != .). - Use
heatplotto create a treatment adoption heatmap with districts on the y-axis and years on the x-axis:heatplot post_adopt i.district_id i.year, /// colors(white dkgreen) /// ylabel(, labsize(tiny) angle(0)) /// xlabel(, labsize(small) angle(45)) /// ytitle("District") xtitle("Year") /// legend(order(1 "No Seed" 2 "Seed Adopted")) /// graphregion(color(white)) - Export the heatmap as a
.pngand input it into your Overleaf document.