I have a question regarding preparation before performing fixed effects models. I conducted fixed effects analysis in Stata 18 using the code xtreg varlist, fe. Before this, I set up the data with xtset id wave. My question is whether I need to specify the transition of my independent variable. For example, I am examining the association between marital transition and changes in health. Should I generate a transition variable like this:
gen marital_ch = (10*maritalstatus) + L.maritalstatus
xtreg health i.marital_ch, fe
From this, I get the following transitions in marital_ch:
xtreg health i.maritalstatus, fe
The marital status variable is binary. I have already included the fixed effects and set up xtset. Stata can automatically capture the transitions for me.
gen marital_ch = (10*maritalstatus) + L.maritalstatus
xtreg health i.marital_ch, fe
From this, I get the following transitions in marital_ch:
- Married to married
- Married to unmarried
xtreg health i.maritalstatus, fe
The marital status variable is binary. I have already included the fixed effects and set up xtset. Stata can automatically capture the transitions for me.
Comment