Announcement

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

  • -stsplit with two binary time-varying covariates

    I'm doing a Cox regression analysis with two independent binary time-varying covariates. With one binary time-varying covariate, I do the -stsplit trick to split the follow-up into pre- and post-follow-up intervals. How do I apply the -stsplit trick with two binary time-varying covariates? Splitting using x1 and then x2, as in the code below, creates only two time intervals instead of four (as it should for cases with both x1 and x2). What am I doing wrong?
    Code:
        replace time_to_x1 = 99999 if time_to_x1==.
        stsplit post_x1, after(time_to_x1) at(0)
        replace post_x1 = post_x1 + 1
        replace time_to_x2 = 99999 if time_to_x2==.
        stsplit post_x2, after(time_to_x2) at(0)
        replace post_x2 = post_x2 + 1
Working...
X