Announcement

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

  • PH assumption: categorical variable

    After checking the PH assumption I found one variable (4 categories, 1=ref.) to interact with time. The 3rd and 4th category had p-values <0.05. However, the 2nd category did not show a significant interaction with time (p=0.83).

    How can I remove this time varying part (of the 2nd category) from the model?

    I read something about making indicator variables for each category. http://people.upei.ca/hstryhn/nova11/srv_exc_3_sol.pdf
    Maybe there are other suggestions?

    Kind regards,

    Marko

  • #2
    Welcome to Statalist, Marko! I suggest that you read the FAQ, especially section 12. If you don't show us the commands you used and the results (using CODE delimiters), it will be very difficult to advise you.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      My question: How can I remove this time varying effect of _Ifi_2?
      It should be: How can I remove this time varying effect from _Ifi_2?

      If possible (and allowed), I want to report the HR for _Ifi_2 without the time varying effect
      and for _Ifi_3 & 4 with the time varying effect.

      Comment


      • #4
        You had the right idea: create indicator variables for each category, then omit the one for category 2 in the tvc() option. You can most easily create the indicators with the generate() option of tabulate:

        Code:
        tab fi, gen(fi)
        des fi*
        stcox fi2 fi3 fi4 $confounders, robust tvc(fi3 fi4) texp(_t)
        Aside: If you have Stata 11 or higher, then you don't need xi; use factor variables instead. See the help for fvvarlist.

        See the FAQ about cross-posting: if you post in another forum, link to that post; if you resolve your problem in either place, then you close the question in the other. You've already had a serviceable answer at Cross Validated http://stats.stackexchange.com/quest...ract-with-time.
        Last edited by Steve Samuels; 17 Apr 2015, 07:06.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment


        • #5
          Thank you for your answer!

          See also: http://stats.stackexchange.com/quest...ract-with-time

          Comment

          Working...
          X