Announcement

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

  • dealing with a time varying variable in stcox

    I am analyzing survival in a group of respiratory patients
    it turns out that one of my variables (FVC, a measure of respiratory function expressed in percentage of predicted value, that is, the higher the better), has a time-varying effect on survival. If I do
    stcox fvc
    I get an highly significant effect:
    HR .969788, 95% CI .9642006 .9754077
    but estat phtest in unhappy:
    Test of proportional-hazards assumption, Global test chi2 18.03 , df 1, p= 0.0000

    What apparently is happening (plotting the curve of patients above or below the median fvc), is that survival in patients with a better FVC begins to decrease with a delay of about two years compared with those with poorer respiratory function, which makes sense.

    For what I understand from the stata survival analysis reference manual, there are two possible (apparently equivalent) solutions:
    a) use the tvc and tvexp options, that is:
    stcox fvc, tvc(fvc) tvexp(_t>=2)
    b) stsplit the data at time 2 and build an interaction variable with time:
    stsplit twoyears, at(2)
    gen fvc2=fvc*(twoyears==2)
    stcox fvc fvc2

    I did try both solutions, and they give very similar but slightly different solutions:
    solution a gives:
    main HR .9502671 (95% CI .939542 .9611146)
    tvc HR 1.008867 (1.004696 1.013055)


    while solution b:
    -------------+----------------------------------------------------------------
    fvc HR .9590344 ( .9508496 .9672896)
    fvc2 HR 1.020984 ( 1.009306 1.032797)


    Reassuringly, this solution made estat phtest, detail happy:

    fvc rho 0.05118, chi2 1.29, df 1, p= 0.2566
    fvc2 rho -0.02088, chi2 0.20, df 1, p= 0.6525
    Global test chi2 1.64, df 2, p= 0.4409


    my questions are:
    a) Am I correct?
    b) Should I care for the very slight difference?
    c) what should I do with the coefficient of the interaction variable?
    thanks!




    Last edited by Piersante Sestini; 28 Apr 2023, 15:18.

  • #2
    Please disregard. I just realized that tvexp should have been (_t>2)
    Apologies

    Comment

    Working...
    X