Dear Statalisters,
I am trying to set up the data in order to draw the Kaplan-Meier curve.
I have retrospective data for the job history - particularly employment status (12 categories) and the start year - for the first job, second, third, fourth and current job.
I need to calculate from this data the time to non-employment and the failure variable which is becoming non-employed being coded 1.
Could you please guide me through how to do this?
Below is an example from my dataset for your reference.
q6101y represents the start year of the 1st job after leaving education and q6101_01 represents the employment status of this job.
q61021y represents the start year of the 2nd job and q6102_01 represents the employment status of this job and so on until the current job in q6106
These questions are only answered by the individuals who ever worked, i.e. answering the variable evrwrk=1.
Please let me know if you need further elaboration on the data.
Many thanks,
Maye
I am trying to set up the data in order to draw the Kaplan-Meier curve.
I have retrospective data for the job history - particularly employment status (12 categories) and the start year - for the first job, second, third, fourth and current job.
I need to calculate from this data the time to non-employment and the failure variable which is becoming non-employed being coded 1.
Could you please guide me through how to do this?
Below is an example from my dataset for your reference.
q6101y represents the start year of the 1st job after leaving education and q6101_01 represents the employment status of this job.
q61021y represents the start year of the 2nd job and q6102_01 represents the employment status of this job and so on until the current job in q6106
These questions are only answered by the individuals who ever worked, i.e. answering the variable evrwrk=1.
Please let me know if you need further elaboration on the data.
Many thanks,
Maye
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str11 indid byte evrwrk int q6101y byte q6101_01 int q6102y byte q6102_01 int q6103y byte q6103_01 int q6104y byte(q6104_01 q6105 q6106_01) "12010001101" 1 1982 1 1991 8 . . . . 2 . "12010001102" 0 . . . . . . . . . . "12010002102" 1 2004 1 . . . . . . 2 . "12010002103" 1 2002 1 . . . . . . 2 . "12010002104" 0 . . . . . . . . . . "12010002101" 0 . . . . . . . . . . "12010003103" 0 . . . . . . . . . . "12010003101" 1 1980 1 1990 16 1993 6 1995 1 2 . "12010003102" 0 . . . . . . . . . . "12010004103" 0 . . . . . . . . . . "12010004104" 0 . . . . . . . . . . "12010004101" 1 1986 16 1989 1 . . . . 2 . "12010004102" 0 . . . . . . . . . . "12010005102" 0 . . . . . . . . . . "12010005101" 1 1997 1 1998 6 2000 1 2010 1 2 . "12010006101" 1 1985 1 1995 1 . . . . 2 . "12010006102" 0 . . . . . . . . . . "12010007103" 0 . . . . . . . . . . "12010007104" 0 . . . . . . . . . . "12010007105" 0 . . . . . . . . . . "12010007101" 1 1982 1 . . . . . . 2 . "12010007102" 0 . . . . . . . . . . "12010008101" 1 1964 1 1975 1 1983 1 1984 1 2 . "12010008102" 0 . . . . . . . . . . "12010009103" 0 . . . . . . . . . . "12010009102" 0 . . . . . . . . . . "12010009101" 1 1962 1 1988 1 1989 1 1990 1 2 . "12010010102" 0 . . . . . . . . . . "12010010101" 1 2000 16 2003 7 2004 1 2006 1 2 . "12010011101" 1 1991 3 1995 1 1997 1 . . 2 . end label values q6101_01 Lmempst label values q6102_01 Lmempst label values q6103_01 Lmempst label values q6104_01 Lmempst label values q6106_01 Lmempst label def Lmempst 1 "Waged Employee", modify label def Lmempst 3 "Self-Employed", modify label def Lmempst 16 "Other", modify label def Lmempst 6 "Unemployed worked before", modify label def Lmempst 7 "New Unemployed", modify label def Lmempst 8 "Housewife", modify label values q6105 q605 label def q605 2 "no", modify
Comment