Hi all,
I am trying to figure out how to implement a Cox survival analysis with time varying covariates. I am studying the association between a binary covariate X and death (Y). My dataset is with 1 line for each patient and I have in column my binary covariate X, the time to death (0, 6, 12, 18, 24 months), the status death or not and several other covariates that did not vary with time.
But I would like to adjust for a new binary variable yes no but this variable can take different values at each time point. It can be yes 1 at baseline then 0 at 6 months then again 1 at 18 months. The time at which it varies is the same that the time to death which is the visit actually.
I am not sure how to do that, especially how my dataset should look like long wide ? code : tvc?
Someone to help me?
Many many thanks!
PM
I am trying to figure out how to implement a Cox survival analysis with time varying covariates. I am studying the association between a binary covariate X and death (Y). My dataset is with 1 line for each patient and I have in column my binary covariate X, the time to death (0, 6, 12, 18, 24 months), the status death or not and several other covariates that did not vary with time.
But I would like to adjust for a new binary variable yes no but this variable can take different values at each time point. It can be yes 1 at baseline then 0 at 6 months then again 1 at 18 months. The time at which it varies is the same that the time to death which is the visit actually.
I am not sure how to do that, especially how my dataset should look like long wide ? code : tvc?
Someone to help me?
Many many thanks!
PM
Comment