Announcement

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

  • stpm2cr - _status and _event indicator (_d) do not match?

    Hi everyone,

    I'm working to use -stpm2cr- to fit a flexible parametric model for survival data. -stpm2- worked so well and was appreciated by my committee, so I've proposed to use this approach for my analyses that involve competing risks. However, I'm getting an error with the code and have not been able to figure out where I'm going wrong.

    Code:
     stset tevent2outcome, id(PID) failure(status3yr==1, 2, 3) exit(time 36)
    
    * status3yr: CV Outcome = "1", Death = "2", End of Follow-Up or Censored at Study End = "3"
    
    stpm2cr ///
        [CV Outcome: study_grp, scale(hazard) tvc(study_grp2) dftvc(5)] ///
        [Death: study_grp, scale(hazard) tvc(study_grp2) dftvc(5)], ///
            events(status3yr) cause(1 2) censvalue(3) eform level(95)
    The error I get says Events (_status) and event indicator (_d) do not match. I think I have stset the data correctly - the Mozumder paper that has the tutorial has all events specified in -stset-. I have the two competing risks specified in the -cause- option and the censored value in -censvalue-. Obviously, something isn't working! I'd welcome suggestions for where I might look next to sort out this error.

    Thanks!

  • #2
    I've done some more tinkering and I've been able to get the model to run. Here's the revised code:

    Code:
     stset tevent2outcome, id(PID) failure(status3yr==1, 2) exit(time 36)  
    
    * status3yr: CV Outcome = "1", Death = "2", End of Follow-Up or Censored at Study End = "3"  
    
    stpm2cr ///     [CVOutcome: study_grp, scale(hazard) df(5) tvc(study_grp2) dftvc(5)] ///    
                          [Death: study_grp, scale(hazard) df(5) tvc(study_grp2) dftvc(5)], ///        
                          events(status3yr) cause(1 2) censvalue(0) eform level(95)
    I amended the -stset- line to only have the failure levels, removed an errant space in the first equation between 'CV' and 'Outcome', and added the -df(5)- statement and the code runs.

    What I want to understand next is why this only works when -censvalue(0)- is written. I have my censored observations set in level 3 of variable -status3yr-, and -censvalue- is supposed to specify the indicators in - events()- for censored individuals. I thought that if I set it to -censvalue(3)- that it would work?

    If I add '3' to the stset command and '3' as -censvalue(3)- I get the same error as in my first post, so I suspect the error is here somewhere.

    Suggestions welcomed!
    Last edited by Sean Hardiman; 12 Nov 2022, 14:52. Reason: Edited for formatting.

    Comment


    • #3
      Further updates for anyone who is keeping score at home. Recoding censored observations in variable -status- to level 0 allowed the model to run. On to the next problem! Thanks to everyone who took the time to read!

      Comment

      Working...
      X