Dear StataListers,
I have a longitudinal dataset with observational data, please see the photos which are clearer than any explanation undoubtedly.
I would like to add rows when necessary in order to get chronological data.
Basically there are 2 objectives:
(1) Every start date should be identical to the previous end date, so that there is no gap in term of time.
(2) The state and house variables are time-dependent and should change accordingly.
Also please note that the individuals in the dataset can have more than only 2 lines.
I believe a forval or foreach command can do the trick, but I am not yet an expert in macros to find a solution.
Any help would be appreciated, thanks!
I have a longitudinal dataset with observational data, please see the photos which are clearer than any explanation undoubtedly.
I would like to add rows when necessary in order to get chronological data.
Basically there are 2 objectives:
(1) Every start date should be identical to the previous end date, so that there is no gap in term of time.
(2) The state and house variables are time-dependent and should change accordingly.
Also please note that the individuals in the dataset can have more than only 2 lines.
I believe a forval or foreach command can do the trick, but I am not yet an expert in macros to find a solution.
Any help would be appreciated, thanks!
Comment