I am trying to create multiple dummies for an event study with the following loop:
Unfortunately, I keep getting the message "invalid syntax." I think it has something to do with the fact that my time variable was created using the following command:
Which is the composition of year (ano) and month of my panel that generated a float value.
Code:
forval y=2018m1/2019m12 { gen d`y' = (year_month==`y') local x = `y' - 2018m10 local z = abs(`x') if `x'<-1 { gen treated_Tm`z' = support * d`y' } if `x'>-1 { gen treated_Tp`z' = support * d`y' } }
Code:
gen year_month=ym(ano,month) format year_month %tm
Comment