Hi Statalist,
I am trying to find the decrease of a count variable during the covid-19 pandemic caused by lockdowns, using the difference-in-differences method. I have a monthly dataset of six years (2015-2020) for 57 areas. Lockdowns start from March of 2020, so I want to compare the output y (a count variable) of march_onwards 2020 with the previous periods of march_onwards (2015…19) having as a control the first two months of each year.
I think that Poisson will be more proper, however, I also want to use didregress and compare the results.
I use the following commands:
xtset areas time_my
xtdidregress ( y i.march_onwards i.year2020) (did), group(month) time(time_my) nogteffects
where:
areas=1…57
month=1…12
march_onwards takes 1 for march until December and 0 otherwise
year2020 takes 1 for 2020 and 0 otherwise
did=maerch_onwards*year2020
month=1…12
time_my is a var with month and year, for ex.2015m1
and I am getting “area not nested within month”
I am stuck and I cannot understand what am I doing wrong.
I am trying to find the decrease of a count variable during the covid-19 pandemic caused by lockdowns, using the difference-in-differences method. I have a monthly dataset of six years (2015-2020) for 57 areas. Lockdowns start from March of 2020, so I want to compare the output y (a count variable) of march_onwards 2020 with the previous periods of march_onwards (2015…19) having as a control the first two months of each year.
I think that Poisson will be more proper, however, I also want to use didregress and compare the results.
I use the following commands:
xtset areas time_my
xtdidregress ( y i.march_onwards i.year2020) (did), group(month) time(time_my) nogteffects
where:
areas=1…57
month=1…12
march_onwards takes 1 for march until December and 0 otherwise
year2020 takes 1 for 2020 and 0 otherwise
did=maerch_onwards*year2020
month=1…12
time_my is a var with month and year, for ex.2015m1
and I am getting “area not nested within month”
I am stuck and I cannot understand what am I doing wrong.
Comment