Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Generating KM curves in stratified analysis with time varying covariate

    I am trying to generate KM curves in a survival analysis that is stratified by matched pairs and also adjusted for a time varying covariate. In short, stcurve doesn't seem to be an option and I cannot figure out how to get sts graph to work accurately (details below).

    Data: The data are set up with multiple observations per individual. There are two groups of subjects: those who ever used treatment (_treated==1) and those who never used treatment (_treated==0). The data are organized by visit number (vnum) and subjects are matched by several variables (not shown). On the day of starting treatment (niv_rx==1) the users are matched to a never user. The survival (match_time) since the date of matching (match_visit==1) is then compared to see if treatment has an effect on survival.

    In addition, I have a time-varying covariate (niv_hrs) which indicates the number of hours per day that the subject was using therapy.

    An example of two matched pairs is below

    Click image for larger version

Name:	table.jpeg
Views:	1
Size:	142.0 KB
ID:	1531664




    The code and output for my survival analysis is as follows, looking at the survival by receiving therapy, stratified by pair, with niv_hrs as a time-varying covariate. You will see that there is a trend towards a benefit to niv_rx:

    stcox niv_rx, strata(pair) tvc(niv_hrs) vce(robust)

    Click image for larger version

Name:	output.jpeg
Views:	1
Size:	31.3 KB
ID:	1531665


    However, I cannot do stcurve after this analysis as stcurve is not compatible with stratified analyses. Sts graph does not have an obvious way to both stratify by pairs and adjust for the time-varying covariate. Is there another way to accurately represent this survival curve? Such as through graphing a twoway line to do this with post-estimation commands?

    Thank you so much in advance for your time and effort!

    JT
Working...
X