Hello to everyone,
I have a dataset with several years of data. I am doing an event study on this dataset. For one year (due to COVID-19), I have no data. Although this year is not included in the estimation (and therefore has no coefficient), I would like to show it on the abscissa scale of my coefplot.
With the code below I want to make year 9 appear on the abscissa axis between years 8 (the reference year) and 10.
Does anyone have an idea?
Thank you in advance!
Code:
clear set obs 10000 egen id = seq(), from(1) to(10000) block(1) gen year=1 if id<=1000 replace year=2 if year==. & id<=2000 replace year=3 if year==. & id<=3000 replace year=4 if year==. & id<=4000 replace year=5 if year==. & id<=5000 replace year=6 if year==. & id<=6000 replace year=7 if year==. & id<=7000 replace year=8 if year==. & id<=8000 replace year=10 if year==. & id<=9000 replace year=11 if year==. gen score = 1 + rnormal() reg score ib8.year coefplot, keep(*.year) vertical base mcolor() lpattern(dash) color(black) yline(0,lcolor() lpattern(dash)) xline(8)
Comment