Announcement

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

  • Cox model with competing risk error message

    Dear all,

    I am trying to run a competing model with stata and have always the same error, please see above, I don't know if someone could help me.

    Thanks by advance

    Sophie

    My script is

    egen facid_merge = group(facid5 patcens), label

    gen status=0
    replace status=2 if all_died_7==1
    replace status=1 if hosptype_new==1

    stset eventdt1, origin (start_dt) f(status==1) scale (365.25) id(facid_merge)

    stcrreg mage, compete (status==2)

    The stset part runs well, it is the part with stcrreg that gives the error message :

    option compete(): competing risks events must be stset as censored
    r(459);


  • #2
    What version of Stata are you running? I thought at first that the space after "compete" would trigger the error message, but in Stata 14.2,, that doesn't happen. So, I'm stumped.
    Last edited by Steve Samuels; 17 Jul 2018, 15:03. Reason: Previous answer was wrong.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment

    Working...
    X