Dear Community
I have a cohort data set with patients (patid) who experience a test (K) on date (Ktestdate) between entry (indexdate) and exit(exit). Patients may have had no test, one test or multiple tests. I am trying to set the data up as survival data so that I can fit a Cox regression model to analyse exposure and covariate relationships with test frequency.
I have got as far as creating a timespan variable (Ktime0) to indicate the time between the date of the last test and the next failure(K).
What I want to end up with is a new observation which is the time between the last test (K) and the end of follow-up (exit). I.e. for a patient with only one failure event I want two observations, one from time of entry (indexdate) until failure (K) and a second from the failure (K) until the end of follow-up (exit).
I hope I have outlined the problem clearly and would massively appreciate any help on this matter.
Kind regards
Charlie
Public Health / Health Economics MSC student.
I have a cohort data set with patients (patid) who experience a test (K) on date (Ktestdate) between entry (indexdate) and exit(exit). Patients may have had no test, one test or multiple tests. I am trying to set the data up as survival data so that I can fit a Cox regression model to analyse exposure and covariate relationships with test frequency.
I have got as far as creating a timespan variable (Ktime0) to indicate the time between the date of the last test and the next failure(K).
What I want to end up with is a new observation which is the time between the last test (K) and the end of follow-up (exit). I.e. for a patient with only one failure event I want two observations, one from time of entry (indexdate) until failure (K) and a second from the failure (K) until the end of follow-up (exit).
I hope I have outlined the problem clearly and would massively appreciate any help on this matter.
Kind regards
Charlie
Public Health / Health Economics MSC student.
Comment