Hi everyone!
I'm currently working with a panel dataset that holds data for the years 2010-2020 on residential property values and the distribution centres. I am attempting to create a dummy variable for each given year in the dataset and whether a distribution centre has been built. Thus, the dummy variable must hold for two conditions; the given year (2010, 2011, or 2012, etc.) and a distribution centre surface area which is greater than 1. So far I have tried the following commands but these haven't led to the desired results. I am hoping someone can help me or least tell me what I'm doing wrong.
sum surface_area
gen d.construction2010=0
replace d.construction2010=1 if surface_area>1 & year==2010
__________________________________________________ ____________
gen d.construction2010=1 if surface_area>1 & year==2010
Your help is much appreciated, thanks!
I'm currently working with a panel dataset that holds data for the years 2010-2020 on residential property values and the distribution centres. I am attempting to create a dummy variable for each given year in the dataset and whether a distribution centre has been built. Thus, the dummy variable must hold for two conditions; the given year (2010, 2011, or 2012, etc.) and a distribution centre surface area which is greater than 1. So far I have tried the following commands but these haven't led to the desired results. I am hoping someone can help me or least tell me what I'm doing wrong.

sum surface_area
gen d.construction2010=0
replace d.construction2010=1 if surface_area>1 & year==2010
__________________________________________________ ____________
gen d.construction2010=1 if surface_area>1 & year==2010
Your help is much appreciated, thanks!
Comment