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:
(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:
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
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)
Then I've been trying the following:
Code:
stsplit diabetes, at(failiures)
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

Comment