Hi, I'm attempting to run a fixed effect regression with time dummies, however, I want to measure the impact of the Covid-19 pandemic so I made a dummy for the years 2020 to 2022, to avoid collinearity I can't include those years so I tried dropping them (including 2019 for reference year). But dropping the pandemic years also makes it impossible to include the dummy pandemic. Its a weighted least squares regression with population weights, but that doesn't matter.
This is the code:
*generate a dummy for each year
*drop 2019 to 2022
*dummy variable for the pandemic years, from 2020 to 2022

Running this code it appears it dropped the years 2019 to 2022 as well as the pandemic dummy, in addition to the first year which is 2008. I want to drop the years 2020 to 2022 as well as 2019 as the reference year instead of 2008 while including the dummy pandemic.
This is the code:
*generate a dummy for each year
Code:
tabulate year, generate(year_dummy)
Code:
drop if year >= 2019 & year <= 2022
Code:
gen pandemic = (year >= 2020 & year <= 2022)
Code:
xtreg Commuting Commutingdistance Population_growth Migration Real_income Real_house unemployment pandemic i.year [pweight=sqrt_pop_avg], fe vce(cluster numeric_id)
Comment