Hi All,
I spent a couple days on this problem and so I was hoping if anyone has any help as nothing I do seems quite right. I am using Stata MP 14.2.
I have two sets of data on the same individuals, one is administrative time-span data and the other a regular longitudinal survey. It should be noted that the actual day of the interview for the survey can be anytime over an 18 month window, so each subject has different interview dates and different time between interviews.
So I am wanting to split up particular spells so they are only associated with a particular wave of the longitudinal data.
Here is a mock up of the data structure I am dealing with
As you can see i have spans data for each individual over their history and for each individual I have different but constant (within id) interview data (there is a separate variable for each wave of interviews with a different date).
What I want the data to be would look like this.
So as you can see i am trying to split the spans, however the command
but this command seems to only split at fixed intervals of analysis time not at a variable of calendar points.
I am open to any suggestions
Thank you in advance
I spent a couple days on this problem and so I was hoping if anyone has any help as nothing I do seems quite right. I am using Stata MP 14.2.
I have two sets of data on the same individuals, one is administrative time-span data and the other a regular longitudinal survey. It should be noted that the actual day of the interview for the survey can be anytime over an 18 month window, so each subject has different interview dates and different time between interviews.
So I am wanting to split up particular spells so they are only associated with a particular wave of the longitudinal data.
Here is a mock up of the data structure I am dealing with
id | start | finish | interview |
1 | 12jan2012 | 12feb2012 | 14mar2012 |
1 | 13feb2012 | 31jun2013 | 14mar2012 |
2 | 9aug2013 | 21nov2013 | 31oct2013 |
2 | 22nov2013 | 29nov2013 | 31oct2013 |
What I want the data to be would look like this.
id | start | finish | interview | wave |
1 | 12jan2012 | 12feb2012 | 14mar2012 | 0 |
1 | 13feb2012 | 13mar2012 | 14mar2012 | 0 |
1 | 14mar2012 | 31jun2013 | 14mar2012 | 1 |
2 | 9aug2013 | 30oct2013 | 31oct2013 | 0 |
2 | 31oct2013 | 21nov2013 | 31oct2013 | 1 |
2 | 22nov2013 | 29nov2013 | 31oct2013 | 1 |
Code:
stsplit
I am open to any suggestions
Thank you in advance
Comment