Announcement

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

  • log rank test for adjusted survival curve

    Dear listers,

    i created two survival curve adjusted by age
    how can I compare this two curve. I am not sure I could use “sts test”
    to compare two adjusted curve below is my command , curve is wider but
    i got not significant , please advice me how can i compare adjusted curve


    gen tpa_age=tpa*Age
    sts test tpa_age
    chi2(30) = 24.01
    Pr>chi2 = 0.7714


    xi:stcox Ageyears if tpa==0
    _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    Age | .990738 .0357294 -0.26 0.796 .9231273 1.063301


    xi:stcox Ageyears if tpa==1
    _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    Age | 1.037272 .0244087 1.56 0.120 .9905185 1.086233


    xi:stcox i.tpa Ageyears
    _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    _Itpa_1 | .8745963 .2259029 -0.52 0.604 .527166 1.451001
    Ageyears | 1.030515 .0202899 1.53 0.127 .9915047 1.07106





    curve attach.

    Appreciate your help.
    Thank you
    Attached Files
    Last edited by suganthiny kumarasamy; 05 Jul 2016, 21:44.

  • #2
    For some reason, that graph doesn't seem as if it came from that fitted model. Try running the following code and show the output in a code block and attach the figure.
    Code:
    stset
    stcox i.tpa c.AgeYears
    stcurve , survival at1(tpa=1) at2(tpa=0)
    graph export for_statalist.png
    Last edited by Joseph Coveney; 06 Jul 2016, 01:28. Reason: Sorry, Ageyears, not AgeYears.

    Comment


    • #3
      Suganthiny:
      like Joseph, I find difficult to link the graph you posted to the model you ran.
      However, you can perform the -logrank- test with a hand-made interaction between age and drug:
      Code:
      use http://www.stata-press.com/data/r14/drugtr.dta
      stcox  c.age##i.drug
      g age_drug=age*drug
      stcox  c.age##i.drug /// the result with the -fvvarlist- - made interaction and the hand-made one are the same for both -stcox- regressions
      stcox  age drug age_drug
      sts graph, by( age_drug ) /// the graph is difficult to read and probably unuseful to report
      sts test age_drug , logrank
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Hello Sungathiny,

        It seems your log-rank test has been done for the interaction term, when I guess you wished to perform the test for the group variable.

        You may see that df = 30.

        Below, we have a significant log-rank test for the group variable. Afterwards, we created an interaction term and perform a (non-significant) log-rank test.

        Code:
        . use "http://www.stata-press.com/data/r14/stan3.dta", clear
        (Heart transplant data)
        
        . sts test surgery
        
                 failure _d:  died
           analysis time _t:  t1
                         id:  id
        
        
        Log-rank test for equality of survivor functions
        
                |   Events         Events
        surgery |  observed       expected
        --------+-------------------------
        0       |        69          60.34
        1       |         6          14.66
        --------+-------------------------
        Total   |        75          75.00
        
                      chi2(1) =       6.59
                      Pr>chi2 =     0.0103
        
        . gen surg_age = surgery*age
        
        . tab surg_age
        
           surg_age |      Freq.     Percent        Cum.
        ------------+-----------------------------------
                  0 |        148       86.05       86.05
                 35 |          2        1.16       87.21
                 36 |          2        1.16       88.37
                 43 |          2        1.16       89.53
                 45 |          4        2.33       91.86
                 46 |          2        1.16       93.02
                 47 |          2        1.16       94.19
                 48 |          6        3.49       97.67
                 52 |          4        2.33      100.00
        ------------+-----------------------------------
              Total |        172      100.00
        
        . sts test surg_age
        
                 failure _d:  died
           analysis time _t:  t1
                         id:  id
        
        
        Log-rank test for equality of survivor functions
        
                 |   Events         Events
        surg_age |  observed       expected
        ---------+-------------------------
        0        |        69          60.34
        35       |         0           0.32
        36       |         0           1.66
        43       |         1           0.81
        45       |         1           3.12
        46       |         0           1.12
        47       |         1           1.12
        48       |         2           4.55
        52       |         1           1.95
        ---------+-------------------------
        Total    |        75          75.00
        
                       chi2(8) =       8.09
                       Pr>chi2 =     0.4250

        Hopefully that helps!

        Best,

        Marcos
        Best regards,

        Marcos

        Comment


        • #5
          Thanks you so much Dr.Joseph, Dr.Carlo and Dr.Marcos your valuable comments.

          this code result ican link with the stcox result
          stcox i.tpa c.AgeYears
          stcurve , survival at1(tpa=1) at2(tpa=0)



          i have also difficult to link previous graph and the result i got it from
          stcox all the model give non-significant when i this
          graph command (previous graph)
          sts graph, by(tpa) adj(Ageyears)
          the curve separated widely
          what does this graph tells from this command and when do we use this command



          Thanks soo much

          Comment


          • #6
            It seems your graph conveys differences in survival according to the group (1 or 2), whereas your log-rank test was NOT done so as to account for differences between 2 treatment groups (please see the examples in #4), but for several levels of interaction between treatment group and age.

            Had you "tested" the same way, for example:

            Code:
            .sts test tpa
            I bet the graph and the output will go on the same verge!

            Best,

            Marcos
            Best regards,

            Marcos

            Comment


            • #7
              Thank you so much Dr.Marcos

              Comment

              Working...
              X