Announcement

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

  • Survival analysis (based on panel data) with discrete and continously time-varying covariates

    Dear Stata users,

    currently I am working on a survival analysis that is based on panel data.

    I need to incorporate discrete time-varying covariates (see Var1) as well as continously time-varying covariates (see Var3).

    For a better understaning of the data structure:
    Var-id Var-time Var1 Var2 Var3 Var-exit
    1 1 0 33 22,3 0
    1 2 1 33 44,12 0
    1 3 1 33 0 0
    1 4 1 33 12 1
    2 1 1 101 115 0
    2 2 0 101 115,23 0
    2 3 1 101 123 0
    3 1 0 12 10 0
    3 2 0 12 11 0
    3 3 1 12 12 1
    Step 1: I define my data as survival data:
    stset Var-time, id(Var-id) failure(Var-exit)

    Step 2: I execute the stcox-command:
    stcox Var1 Var2 Var3

    Questions:
    1. Do I need to incorporate the tvc-command, because I am using continously time-varying covariates?
    stcox Var1 Var2 Var3, tvc(Var3) texp(_t)

    2. Do I need to consider that Var1 is a discrete time-varying covariate?

    Thank you for your time and help
    Robert




  • #2
    You have discrete time survival data, so there is no need to use any of the st suite of commands! In fact they are a distraction. Use discrete time methods directly. The discrete time proportional hazards model (analogue to Cox model for continuous time survival time data) is in fact fitted via a cloglog regression applied to data set up as you currently have them. For a free manuscript, and Lessons with hands-on examples of how to do this, see http://www.iser.essex.ac.uk/survival-analysis. The incorporation of time-varying covariates is also discussed. (In short, you'll need to be assuming that your time-varying covariate is constant within each of your time periods -- but may vary across time periods of course.)

    Comment


    • #3
      Dear Professor Jenkins,

      first of all I want to thank you for your very helpful advice. It is very kind that you share your knowledge here in this forum and on your proposed website.

      I do now understand that I have to use a discrete time proportional hazards model. As you mentioned my described data set up seems to be suitable for such a model.

      Now I will run my model as following:

      cloglog Var-exit Var1 Var2 Var3 ln(Var-time), eform

      Question:
      Is this proceeding correct and takes into account that Var1 is discrete time-varying covariate and Var 3 is a continously time-varying covariate? Or do I need to restructure my data set somehow?

      Thank you very much
      Robert

      Comment


      • #4
        That command line, with the data set up as you described in your initial post, will get you started. But the fact that you asked the follow-up question suggests that you're trying to run before you walk. It's a good investment, I suggest, to thoroughly read and digest the materials before proceeding further. The materials will also indicate how you might develop your model specification.

        Comment


        • #5
          Originally posted by Stephen Jenkins View Post
          You have discrete time survival data, so there is no need to use any of the st suite of commands! In fact they are a distraction. Use discrete time methods directly. The discrete time proportional hazards model (analogue to Cox model for continuous time survival time data) is in fact fitted via a cloglog regression applied to data set up as you currently have them. For a free manuscript, and Lessons with hands-on examples of how to do this, see http://www.iser.essex.ac.uk/survival-analysis. The incorporation of time-varying covariates is also discussed. (In short, you'll need to be assuming that your time-varying covariate is constant within each of your time periods -- but may vary across time periods of course.)
          Dear Professor. Can the method you are proposing be applied to panel data in panel setting? I read the help file for the program "pgmhaz8" and did not find year indicator among options. Does it mean that this method ignores the panel structure of the data?

          Comment


          • #6
            Parviz: your post suggests that you don't fully understand what survival analysis is, especially how discrete time survival analysis "works", including the fact that it uses a data set-up that looks like a panel data set-up. The organisation of the data in this way -- together with a couple of specially-defined variables -- is the key to the 'easy estimation' of discrete time survival analysis models. Your reference to "year indicator" confuses the role of "year" as an explanatory variable (or set of indicator variables) and the role of year as in number of years since first at risk of experiencing the event of interest (i.e. a way of summarising the relationship between the discrete hazard rate and elapsed duration). I repeat my advice in #4: "It's a good investment, I suggest, to thoroughly read and digest the materials before proceeding further."

            Comment

            Working...
            X