Announcement

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

  • Cox regression model convergence issues

    Hi there!

    I am fitting a Cox proportional hazards model to a subgroup of my data but I keep receiving the following error: flat region resulting in a missing likelihood

    A snapshot of the structure of my data is below:
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long participantid byte visit str8 subgroup float exposure byte outcome float(covariate time)
    1 1 "group1" 0 0  .8414373    0
    1 2 "group1" 0 0  .8414373   28
    1 3 "group1" 0 0  .8414373   84
    1 4 "group1" 0 0  .8414373  147
    1 5 "group1" 0 0  .8414373  231
    2 1 "group1" 1 0  .6503111    0
    2 2 "group1" 1 0  .6503111   28
    2 4 "group1" 1 0  .6503111  165
    2 5 "group1" 1 0  .6503111  257
    2 6 "group1" 1 0  .6503111  348
    2 7 "group1" 1 0  .6503111  428
    3 1 "group1" 0 0 .56734204    0
    3 2 "group1" 1 0 .56734204  114
    3 3 "group1" 1 0 .56734204  212
    4 1 "group1" 0 0  .8987436    0
    4 2 "group1" 1 0  .8987436   70
    4 3 "group1" 1 0  .8987436   96
    4 4 "group1" 1 0  .8987436  131
    4 5 "group1" 1 0  .8987436  174
    4 6 "group1" 1 0  .8987436  517
    4 7 "group1" 1 0  .8987436 1237
    5 1 "group1" 1 0  .3669614    0
    5 2 "group1" 1 0  .3669614   35
    5 3 "group1" 1 0  .3669614   63
    5 4 "group1" 1 0  .3669614   91
    5 5 "group1" 1 0  .3669614  117
    5 6 "group1" 1 0  .3669614  222
    5 7 "group1" 1 0  .3669614  336
    end

    My code for the model is:
    Code:
    stset time, failure(outcome==1) id(participantid) sc(30.4)
    
    stcox exposure covariate if subgroup=="group2"
    I have tried different methods to handle tied failures (efron, exactm, exactp), as well as increasing the number of iterations but I keep running into the same issue. Any advice of other options to try to help the model converge would be much appreciated.

    Thank you!

  • #2
    Welcome to the forum! Thanks for reading the FAQ and presenting a data example.

    Unfortunately, the example doesn't help much, because it contains no failures/events.

    My guess is you have very few events. Is it possible to post a copy of your output from -stset- for the data to which you are hoping to fit the model? Output from -stcox- would also be useful. Later you might be asked to post the output with additional display options.

    As an aside, you'll probably find the observations with time 0 are redundant (-stset- will set _st to 0 for those observations and you'll get a note in the log).

    There are various maximization options (see the help). Using the -difficult- option would be a start. You can also specify different initial values (the -from()- option). For now, showing the output from -stset- will help.

    Note to other forum users: Please don't hesitate to respond.

    Comment


    • #3
      Hi there, thank you for your response! I apologize for my delayed reply.

      Below is the output from stset:

      Code:
      Survival-time data settings
      
      ID variable: participantid
      Failure event: outcome==1
      Observed time interval: (time[_n-1], time]
      Exit on or before: failure
      Time for analysis: time/30.4
      
      --------------------------------------------------------------------------
      1,140 total observations
      250 observations end on or before enter()
      60 observations begin on or after (first) failure
      --------------------------------------------------------------------------
      830 observations remaining, representing
      197 subjects
      4 failures in single-failure-per-subject data
      1,860.559 total analysis time at risk and under observation
      At risk from t = 0
      Earliest observed entry t = 0
      Last observed exit t = 40.69079
      Unfortunately, there are very few events/failures but I am still hoping to document the hazard ratios nonetheless. Thank you for your help!

      Comment

      Working...
      X