Dear Stata users,
currently I am working on a survival analysis that is based on panel data.
I need to incorporate discrete time-varying covariates (see Var1) as well as continously time-varying covariates (see Var3).
For a better understaning of the data structure:
Step 1: I define my data as survival data:
stset Var-time, id(Var-id) failure(Var-exit)
Step 2: I execute the stcox-command:
stcox Var1 Var2 Var3
Questions:
1. Do I need to incorporate the tvc-command, because I am using continously time-varying covariates?
stcox Var1 Var2 Var3, tvc(Var3) texp(_t)
2. Do I need to consider that Var1 is a discrete time-varying covariate?
Thank you for your time and help
Robert
currently I am working on a survival analysis that is based on panel data.
I need to incorporate discrete time-varying covariates (see Var1) as well as continously time-varying covariates (see Var3).
For a better understaning of the data structure:
Var-id | Var-time | Var1 | Var2 | Var3 | Var-exit |
1 | 1 | 0 | 33 | 22,3 | 0 |
1 | 2 | 1 | 33 | 44,12 | 0 |
1 | 3 | 1 | 33 | 0 | 0 |
1 | 4 | 1 | 33 | 12 | 1 |
2 | 1 | 1 | 101 | 115 | 0 |
2 | 2 | 0 | 101 | 115,23 | 0 |
2 | 3 | 1 | 101 | 123 | 0 |
3 | 1 | 0 | 12 | 10 | 0 |
3 | 2 | 0 | 12 | 11 | 0 |
3 | 3 | 1 | 12 | 12 | 1 |
stset Var-time, id(Var-id) failure(Var-exit)
Step 2: I execute the stcox-command:
stcox Var1 Var2 Var3
Questions:
1. Do I need to incorporate the tvc-command, because I am using continously time-varying covariates?
stcox Var1 Var2 Var3, tvc(Var3) texp(_t)
2. Do I need to consider that Var1 is a discrete time-varying covariate?
Thank you for your time and help
Robert
Comment