Announcement

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

  • Cox ED in Stata?

    Hello there,

    I will soon be writing my master's thesis in political science. As a method I will use a cox regression. In contrast to a logistic regression, the variable time can be included much better with a cox regression.
    One can determine not only if, but also when an event (e.g., party exit or government collapse) occurs.
    Recently I read about Cox ED - expeted durations.
    Instead of a somewhat cryptic hazard ratio/rate, this gives a time value that expresses how many days/months earlier or later that variable caused the event to occur or be delayed. (more info: https://doi.org/10.1017/S000712341700045X)
    Super useful - I definitely want to use this!

    Problem: The inventors have written down the necessary steps only in R so far. I don't know R, but I know Stata quite well.

    Is it basically possible to rebuild Cox ED in Stata?
    The R package as well as the corresponding description can be found here: https://github.com/jkropko/coxed.

    If there is already a similar forum post, feel free to link it to me.

    Kind regards

  • #2
    some discussion that may be helpful.
    HTML Code:
    https://www.statalist.org/forums/forum/general-stata-discussion/general/1355556-creating-duration-variables-for-cox-model-application

    Comment


    • #3
      Thanks for the tip.

      Unfortunately the thread is about customizing the dataset. I am specifically looking for a way to display the results from the cox regression differently.
      Originally posted by George Ford View Post
      some discussion that may be helpful.
      HTML Code:
      https://www.statalist.org/forums/forum/general-stata-discussion/general/1355556-creating-duration-variables-for-cox-model-application

      Comment


      • #4
        I am not convinced that this is a good idea. The whole point of Cox regression is that you can define the hazard ratios without having to estimate the baseline hazard. That is both its strength and its weakness. You cannot undo the weakness (that you only get hazard ratios) without at the same time eliminating the advantage (that it is semiparametric, i.e. that it does not require assumptions about the baseline hazard function). If you really don't like the disadvantage, then the best solution is to not use a Cox model. Models are tools, and you should use the right tool for the right job. Cox regression is great for a specific set of problems. If your problem is not part of that set, then it is the wrong model for you. Trying to "fix" the Cox model, like Cox ED does, will only result in a Frankenstein model that gives the perception that you can have your cake and eat it too.

        That does not mean that your wish of presenting the results in terms of a metric your intended audience understands is wrong. In fact, I agree that that is an important consideration. I would not consider hazards and hazard ratios "cryptic". They have a well defined meaning that can be understood. In fact, if you are the one doing the analysis, then you have no choice: Hazards are so central to the underlying idea of survival analysis that you cannot understand your models without understanding the concept of a hazard. Once you understand what a hazard is, you also know what a hazard ratio is (it is a ratio of hazards, and if you can understand a survival model than it is safe to assume you are also comfortable with the concepts of division and multiplication). However, there are still cases where you legitimately want to present your results in another format than hazard ratios, but that choice is not as one sided as your question suggests. If you are in such a case then the right choice is to abandon the Cox model and go for an alternative that does explicitly estimate the baseline hazard function. In Stata stpm2 jumps to mind, as the kind of model that is intended for the kind of use you seem to want. You can start reading on that here: https://www.stata-journal.com/articl...article=st0165
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment

        Working...
        X