I want to capture the change in variables in my panel dataset, such as marital status. Below, I have grouped people into three categories, (1) those that are married (2) those that are de facto [remain as such while in a given relationship], and (3) those that start as de facto then marry. Is there a better way to code for these changes.
Code:
gen union = 1 if mrcurr==1 & p_mrcurr==1 & f1.mrcurr==1 & f1.p_mrcurr==1 // married replace union = 2 if mrcurr==2 & p_mrcurr==2 & f1.mrcurr==2 & f1.p_mrcurr==2 // de facto replace union = 3 if mrcurr==2 & p_mrcurr==2 & f1.mrcurr==1 & f1.p_mrcurr==1 // de facto to married
Comments appreciated.
0 Response to How best to control for / identify changes in variables over time
Post a Comment