Good afternoon, I am trying to create dummy variables with two conditions 1) name of province 2) year law was passed. Laws were not passed at the same time and what I have is panel data. So far my option is to use the following code, meaning i will have to do this for all provinces. Is there a way I can run one code for all provinces?
gen dummy=1 if province=="myprovince" & year>=1995
replace dummy=0 if dummy==.
tab dummy province, mi
tab dummy year, mi
gen dummy=1 if province=="myprovince" & year>=1995
replace dummy=0 if dummy==.
tab dummy province, mi
tab dummy year, mi
Comment