I'm following your Survival Analysis guideline (https://www.iser.essex.ac.uk/resourc...sis-with-stata) and An Introduction to Survival Analysis Using Stata by Cleves et al. (2008).
I would like to ask your help about transforming panel data to duration data. I have a panel data with monthly observations of individuals' depression status. My research question is how individual characteristics affect the duration of depression stage. The problem is when I use the snapspan command, I could not control interval truncation in the data and missing observations counted as they were observed.
Current format of my data for individual A is:
Code:
+------------------------+ | month event gender | |------------------------| A. | 1 0 Female | A. | 6 0 Female | A. | 8 1 Female | A. | 9 1 Female | A. | 10 1 Female | +------------------------+
Code:
snapspan individualidsys month event, gen(date0) replace rename month date1
Code:
+--------------------------------+ | date0 date1 event gender | |--------------------------------| A. | . 1 0 . | A. | 1 6 0 Female | A. | 6 8 1 Female | A. | 8 9 1 Female | A. | 9 10 1 Female | +--------------------------------+
In the duration data it seems like I observed the individual A from month 1 (January) to month 6 (June) and from month 6 to month 8 which are not the case. My questions:
1) Would that be a problem, if so how should I fix the missing observation problem in transforming the data?
2) I'm planning to use following stset command
Code:
stset date1, id(id) time0(date0) failure(event==1)
Best regards,
John
0 Response to Missing values in snapspan command @StephenJenkins
Post a Comment