I have a panel consisting of individuals who moved at some point within the panel's time frame, where the panel ID (id) represents individuals, and the time ID (date) represents days of the year. The average number of observations per year for each id is 2 (this doesn't mean that the person moves twice; just that their data is updated twice). I want to understand the impact on the individual binary variable y (for example, being married) of moving to a neighborhood with attribute X versus attribute Z, using the difference-in-differences method. It's important to note that this attribute can take other values (such as W and K) and varies yearly. In other words, the treatment is at the neighborhood-year level. Since people move at different times, I understand that the correct approach is a generalized DID with two-way fixed effects.
From my understanding (please feel free to correct me if I'm wrong), I should run:
sort id date
xtset id date
gen treat = haveMoved*X
reghdfe y treat if inlist(attribute, X, Z) & inlist(event_t, -1, 0), absorb(date id) cluster(neighborhood#yearMove)
Where haveMoved equals 1 if the person has already moved and 0 otherwise, treat represents having moved to a neighborhood with attribute X, event_t == 0 is the observation when the move occurs, and yearMove is the year of the move, so to cluster at the treatment level. My questions are:
1) Should I include fixed effects for neighborhoods, or would it be redundant since individual fixed effects are necessary for TWFE?
2) I ask the same question as (1) for year fixed effects, since I include date fe.
3) Is the approach of only keeping periods -1 and 0 in the estimation correct?
I genuinely appreciate any help anyone can provide.
From my understanding (please feel free to correct me if I'm wrong), I should run:
sort id date
xtset id date
gen treat = haveMoved*X
reghdfe y treat if inlist(attribute, X, Z) & inlist(event_t, -1, 0), absorb(date id) cluster(neighborhood#yearMove)
Where haveMoved equals 1 if the person has already moved and 0 otherwise, treat represents having moved to a neighborhood with attribute X, event_t == 0 is the observation when the move occurs, and yearMove is the year of the move, so to cluster at the treatment level. My questions are:
1) Should I include fixed effects for neighborhoods, or would it be redundant since individual fixed effects are necessary for TWFE?
2) I ask the same question as (1) for year fixed effects, since I include date fe.
3) Is the approach of only keeping periods -1 and 0 in the estimation correct?
I genuinely appreciate any help anyone can provide.
