Announcement

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

  • Cox proportional model (stcox) - flat or discontinuus region encountered

    I'm trying to run a very simple multilevel Cox proportional hazard model (stcox) and am getting "numerical derivatives are approximate; flat or discontinuous region encountered."

    My command is:

    stcox gender, shared(patient_id).

    I'm using a reduced test dataset that has 1518 observations with 32 failures. I'm estimating the risk of a patient getting an infection (yes or no) during hospital stays. A patient can have more than one hospital stay, so hospital stays are the unit of analysis and stays are nested within patients. Only one hospital is involved.

    I've tried specifying both efron and breslow to handle ties but the result is the same.

    However, this model works:

    stcox gender, vce(cluster patient_id).

    But my understanding is that vce(cluster) may not be ideal and may violate the proportionality assumptions. From the STATA manual:

    "One solution would be to fit a standard Cox model, adjusting the standard errors of the estimated hazard ratios to account for the possible correlation by specifying vce(cluster patient).
    We could instead model the correlation by assuming that the correlation is the result of a latent patient-level effect, or frailty. That is, rather than fitting a standard model and specifying vce(cluster patient), we could fit a frailty model by specifying shared(patient)".

    Any idea what could be causing this simple model to fail?

  • #2
    Bob:
    welcome to this forum.
    You actually coded two different -stcox- specifications (see https://www.stata.com/bookstore/surv...-introduction/, Third ed: 200-203).
    That said, a single predictor is really insufficient to run your codes successfully (and -stcox- in general).
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      > You actually coded two different -stcox- specifications

      I'm not sure what you mean. Are you saying I coded two different specifications with this one line?:

      Code:
      stcox gender, shared(patient_id)
      (I have the Revised 3rd edition and pgs 200 - 203 are about the sts command for the Kaplan-Meier survivor function. I did read through the section on stcox and still don't see what you're pointing out.)

      All of the examples I've seen for a 2-level cox model follow the format I used. I have more predictors but dropped it to one because including them all led to the same error - flat or discontinuous region encountered.

      Comment


      • #4
        Bob:
        I might have been mistaken with full reference, but there's a differnent description for your two codes (the -shared frailty- option is described as a random effect model). I'm currently out of office at the moment. Tomorrow I'll double check and let you know.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Bob:
          see Chapter 10.6 same reference (page 199-203).
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment

          Working...
          X