Cross Validated
2022-07-29 23:45 UTC
By user1813615
AI-113-20220729-social-media-d183e589
How to create KM curves with time-dependent covariate
Some patient received an treatment as treated group and some did not as control group. In order to consider "immortal time bias" , I coded the treatment as a time-dependent covariate. Could you let me know it is right or not? Thanks. For example, there are two patients: P1 received the treatment 30 days after the start of this study and died 30 days after receiving the treatment. P2 did not received the treatment and survived at the end of this study (80 days). Here I code the data as follow: ID Treatment Time Death P1 0 30 0 P1 1 30 1 P2 0 80 0 Then I just used SAS code to create KM curves /*Survival curve*/ proc lifetest data=treatment; time Time*Dearg(0); strata Treatment; run;
Some patient received an treatment as treated group and some did not as control group. In order to consider "immortal time bias" , I coded the treatment as a time-dependent covariate. Could you let me know it is right or not? Thanks. For example, there are two patients: P1 received the treatment 30 days after the start of this study and died 30 days after receiving the treatment. P2 did not received the treatment and survived at the end of this study (80 days). Here I code the data as follow: ID Treatment Time Death P1 0 30 0 P1 1 30 1 P2 0 80 0 Then I just used SAS code to create KM curves /*Survival curve*/ proc lifetest data=treatment; time Time*Dearg(0); strata Treatment; run;
Full article content could not be extracted automatically. Read the original below.
Source:
Cross Validated
· stats.stackexchange.com