Announcement

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

  • Help with stsplit

    Hi I'm doing a survival analysis looking at the risk of exposure (case) on outcome (disease)

    But there is also a 3rd disease- diabetes- which happens in some people at some point between time they become exposed and when they get the outcome disease.
    I'd like to include diabetes a time varying covariate using stplit command, but am having trouble with it.

    I'd like to split the data, creating two rows for the people who get diabetes represeting the period they're not explosed, and the period when they're explosed, thereofre splitting on diabetes failiure.

    Firstly I stset my data on the diabetes outcome:

    Code:
    stset time_, failiure(_type2==1) id(patid)
    (time_ is the time to either the diabetes diagnosis, death or exit from the study, _type2 is indicator of whether they get diabetes and patid is patient identifier)

    Then I've been trying the following:
    Code:
    stsplit diabetes, at(failiures)
    but get the following error:

    invalid numlist
    option at() must contain nonnegative values
    r(121)

    I assume that I have my data set up incorrectly- but can't work out

    Thanks

    Nerys

  • #2
    Hi,

    Not sure if this will be the solution for you, but I had a problem with the same error code, when using this command:

    Code:
     stsplit new_time if masterop2!=0, at(optime)
    I changed it to:

    Code:
    stsplit new_time if masterop2!=0, at(0) after(op_time)
    And that seemed to work.

    Comment

    Working...
    X