Announcement

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

  • error message "duplicate knots positions" using stpm2

    Dear Stata Users,

    I use the command stpm2 by Royston/Lambert that is designed to estimate flexible parametric survival models (see link below). The procedure requires to specify a number of knots for the baseline hazard function. Their locations are set by default but the user may also specify knot positions. I tried some analysis and encountered a problem. When I set a number of knots greater than 1, I receive an error message "You have duplicate knots positions for the baseline. Try using fewer degrees of freedom or specifying the knots yourself." I really would like to try at least two knots. I tried specifying knot locations by using the option knots(20 50 80) knscale(centile) However, this didn't help. I suppose it's got something to do with the data: transitions are observed on a monthly time scale - first, transitions happen very quickly: about 2 thirds of all transitions take place in the second month, further transitions occur slower, i.e. transition rate decreases gradually. Maybe this shape causes troubles for knot locations. If anyone is more familiar with stpm2 or flexible proportional hazard models I would be glad for a confirmation of this guess or further ideas about possible causes of the error message.
    Thank you,
    Oliver

  • #2
    This probably means that you have many ties in your event times. To see where the knots are placed on the time scale, try centile _t if _d==1, centile(0 20 50 80 100).

    Comment


    • #3
      Thank you Paul! That helped!

      Comment


      • #4
        Hi Paul, I got an opportunity to attend a course on flexible parametric modelling taught by you. I am trying to fit a survival model using stpm2 and get the same error message:
        "stpm2 i.stdbwt5, scale(hazard) df(4) eform
        note: delayed entry models are being fitted
        You have duplicate knots positions for the baseline.
        Try using fewer degrees of freedom or specifying the knots yourself."


        Then I tried again like this: stpm2 ib4.stdbwt5, scale(hazard) knots(30 50 70) knscale(centile) but still get exactly the same error message. The study subjects were followed up for heart disease from age 30 to 70 and attained age was used as the underlying timescale. The knots on the time scale look like this:

        centile _t if _d==1, centile(0 20 50 80 100)

        -- Binom. Interp. --
        Variable | Obs Percentile Centile [95% Conf. Interval]
        -------------+-------------------------------------------------------------
        _t | 3,633 0 32.846 32.846 32.846*
        | 20 65.7024 65.22215 66.03676
        | 50 70 70 70
        | 80 70 70 70
        | 100 70 70 70*

        * Lower (upper) confidence limit held at minimum (maximum) of sample

        I am not sure if I understand this output correctly and would be grateful to have more advice to get around the problem.
        Thank you in advance!
        Zakir

        Comment

        Working...
        X