Announcement

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

  • checking proportional hazards assumption with stcox: tvc()-option vs. inserting interaction manually --> very different results?!

    Dear all,
    I just fit a Cox model with the Efron approximation for tied data with interactions of specific covariates and survival time to account for violations of the proportional hazards assumption. To do so, I first used stcox with the efron option and inserted the interactions with linear survival time "by hand".
    As I expected, this yielded results similar to those obtained earlier from a cloglog-discrete time model.

    However, on the way I realized that stcox has built-in options to include interactions with survival time, i.e. tvc( varlist ) and tvexp( exp ).
    When using these options instead of interacting survival time by hand the results are very different both from cloglog but more surprisingly from stcox with interactions inserted manually.

    I read the manual of stcox and the tvc-option and as I understood stata justs inserts interactions with time - just as I did. But apparently this is not what is going on.
    So, why are the results so very different when using tvc() instead of manually adding interactions with time to the model?

    What am I doing wrong when inserting the interactions by hand?

    Here is the code I used:
    Code:
    stcox ///
            ethn_ger ///
            post96 ///
            treat ///
            i.male ///
            c.immiage ///
            c.ftexp_bef ///
            i.noschool ///
            i.noprof ///
            c.ueexp_bef ///
            c.immi_ue_rate ///
            i.poland i.romania i.ussr ///
            c._t#1.ethn_ger ///
            c._t#1.post96 ///
            c._t#1.treat ///
            c._t#1.male ///
            c._t#c.immiage ///
            c._t#c.ftexp_bef, ///
            efron r
    est store coxefron
    
    stcox ///
            ethn_ger ///
            post96 ///
            treat ///
            i.male ///
            c.immiage ///
            c.ftexp_bef ///
            i.noschool ///
            i.noprof ///
            c.ueexp_bef ///
            c.immi_ue_rate ///
            i.poland i.romania i.ussr, ///
            efron r tvc(ethn_ger post96 treat male immiage ftexp_bef) texp(_t)
    est store coxefron2
    And heres the output:
    Interactions with survival time added by hand:
    Click image for larger version

Name:	stcox_notvc.png
Views:	1
Size:	29.4 KB
ID:	1359979







    Time interactions using tvc-option:
    Click image for larger version

Name:	stcox_tvc.png
Views:	1
Size:	29.2 KB
ID:	1359980

    Last edited by Boris Ivanov; 12 Oct 2016, 03:44. Reason: typos

  • #2
    I just realized a minor confusion in above formulation: When I use the tvc-option on stcox, results are similar to those from the cloglog-model for discrete time (where I added time-interactions by hand). In contrast, when I instead add the time interactions to stcox by hand, results are quite different than in cloglog and in stcox with tvc-option. Sorry for the imprecision, but thats actually what surprised me -- that adding interaction terms to stcox by hand seems to have quite different effect than in the cloglog-command, although conceptually both models work similar if I understood correctly.

    Comment


    • #3
      You may find my answer here interesting.

      Comment


      • #4
        That is the exact answer to my question, thank you very much, Dimitriy!
        So, when using the tvc( )-option stata "quietly" creates a multi-episode dataset with one row for each survival time "unit" per person, but still reports the number of individuals as the number of observations in the regression output? That is, in your examlple, when using the tvc-option it would report 106 observations, although the model was acutally run on 558 observations?

        Comment


        • #5
          The number of observations changes, but the number of subjects is always 48, and the number of failures is 31, the time at risk is 714, and the standard errors are all the same, so nothing substantive changes.

          Comment


          • #6
            Alright, I'll make up my mind about it. Thank you for your reply!

            Comment

            Working...
            X