Announcement

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

  • Non proportionality of Cox model, using piece-wise constant exponential model instead

    Hi,
    I am studying union formation and dissolution of first and second-generation immigrants in the host country and compare to natives (employ event history analysis techniques). I use the Cox proportional hazard model and competing risk model using stcrreg, I have both time constant and time-varying variables. I split the data for time-varying variables at the time point for instance each respondent graduate from primary school, lower secondary, upper secondary and finally tertiary. Covariates are as follows;

    Time constants: migration status(3 categories), sex(two categories), birth cohort(3 categories)
    Time-varying : education(4 categories), pregnancy(2 categories), parity(3 categories)

    1st question

    Since proportionality assumption for both the Cox model and competing risk model using stcrreg doesn't hold, I try the piece-wise constant exponential model. After stset and split my data for time-varying variables. I first tried this
    xi: stpiece i.cohort i.preg i.numkid, tp(0,60,84,108,132,180,204) tv( i.migstatus i.sex_gen i.eductv) ( I put nonproportional covariates after tv option), but it doesn't give results in tv option as categorical)
    So I tried this without using tv option, it works, but I am not sure if this is what I suppose to do?
    xi: stpiece i.migstatus i.sex_gen i.cohort i.eductv i.preg i.numkid, tp(0,60,84,108,132,180,204)

    2nd question

    How to incorporate competing risk model with the piecewise constant exponential model? Do I have to stset my data for competing events separately than use stpiece as below or any other suggestion?

    stset beg, failure(typeb=1) origin(origin14) id(id)
    split data for timevarying variables
    xi: stpiece i.migstatus i.sex_gen i.cohort i.eductv i.preg i.numkid, tp(0,60,84,108,132,180,204)

    stset beg, failure(typeb=2) origin(origin14) id(id)
    split data for timevarying variables
    xi: stpiece i.migstatus i.sex_gen i.cohort i.eductv i.preg i.numkid, tp(0,60,84,108,132,180,204)

    Thank you in advance,

    Muserref Erdogan
    Last edited by Muserref Er; 08 Apr 2020, 05:19.

  • #2
    I know this wasn't your question, but using a piece-wise constant exponential (PCE) model is not an obvious solution to non-PH. Cox and PCE are conceptually similar, they both assume proportional hazards by default but the PH assumption can be relaxed in both by including time-varying effects of covariates. The main conceptual difference is that the hazard is smooth in the Cox model and a step function in PCE. You can make the PCE equivalent to the Cox model by splitting at the event times; see https://bendixcarstensen.com/WntCma.pdf for details and a link to Stata code that I wrote. In short, you can fit comparable models in either framework. You can relax the proportional hazards assumption in either framework by fitting covariate*time interactions.

    I've never seen -stpeice- but it seems to just be a wrapper for standard commands for fitting PCE models (stsplit followed by streg). It seems that any variable in tv() is included as an interaction with time. If you are not getting what you expect then you may need to check the syntax of -stpiece- (maybe factor variables are not supported). Since you already grasp stsplit, I would suggest just using standard Stata commands (i.e., fit the model with -streg-). You'll get more transparent code and access to advances in how factor variables are dealth with (-stpiece- is over 20 years old).

    In short, there's no reason to abandon stcox and stcrreg because you have non-proportional hazards. Non-proportional hazards can be incorporated in both (either by splitting or using tvc()).

    I'll try and answer at least one of your questions:

    So I tried this without using tv option, it works, but I am not sure if this is what I suppose to do?
    xi: stpiece i.migstatus i.sex_gen i.cohort i.eductv i.preg i.numkid, tp(0,60,84,108,132,180,204)
    No, this is not what you want (based on your description) because this model assumes proportional hazards. You need to work out how to use the tv() option or, better yet, model the interactions with time with -streg- if you want to relax the PH assumption.

    Note that the the distinction between time-varying effects (of time-constant variables) and time varying covariates is important because you have both.

    Comment


    • #3
      Thank you, Paul Dickman, I appreciate your help.
      Your Stata code is very helpful who is new to regression analysis and statistical Softwares like me. It might be a little awkward but my question is this; how do I decide the width of intervals while splitting time, I mean is there any test or tool to get a reference point for this process?

      Comment


      • #4
        You are trying to approximate a smooth function (the hazard as a function of time) with a step function. You need sufficient intervals to approximate the underlying function. If the hazard is constant then one interval will suffice. If the hazard has a turning point (maybe it starts low, increases, and then decreases) then you will need sufficient intervals to capture that. If the hazard changes rapidly early in the follow-up then you'll need narrower intervals there. It's the same consideration as when you choose to categorize any continuous variable; here you are categorizing time.

        Comment

        Working...
        X