Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Is it possible to estimate the cumulative incidence function using stpm2cif when you have competing risks and time-varying covariates?
From
"Turnbull, Alison E." <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Is it possible to estimate the cumulative incidence function using stpm2cif when you have competing risks and time-varying covariates?
Date
Sat, 22 Sep 2012 20:24:46 -0400
Hello,
I've been enjoying the stpm2 command for creating flexible parametric survival models. I've got a nice model including time-varying covariates and time-dependent covariates which looks like this:
stset obs, failure(event1==1) id(id)
stpm2 age_c var1-var10 ///
scale(hazard) knots(3 7 21) ///
tvc(var5 var6) knotstvc(var5 14 var6 14) eform
Now I'd like to model the probability of my primary event taking into account the other possible competing events.
I was hoping to use the stpm2cif post-estimation command.
I have my data set up as follows:
id obs cause event1 outcome time-varying
1 0 1 0 3 4
1 0 2 0 3 4
1 0 3 0 3 4
1 1 1 0 3 8
1 1 2 0 3 8
1 1 3 0 3 8
1 2 1 0 3 12
1 2 2 0 3 12
1 2 3 0 3 12
1 3 1 0 3 0
1 3 2 0 3 0
1 3 3 1 3 0
------------------------------------------------------------------
2 0 1 0 2 3
2 0 2 0 2 3
2 0 3 0 2 3
2 1 1 0 2 9
2 1 2 0 2 9
2 1 3 0 2 9
2 2 1 0 2 4
2 2 2 0 2 4
2 2 3 0 2 4
2 3 1 0 2 7
2 3 2 1 2 7
2 3 3 0 2 7
______________________________________
3 0 1 0 1 3
3 0 2 0 1 3
3 0 3 0 1 3
3 1 1 0 1 5
3 1 2 0 1 5
3 1 3 0 1 5
3 2 1 1 1 6
3 2 2 0 1 6
3 2 3 0 1 6
Etc.
I assumed the correct way to stset my data would be as follows
stset obs, failure(event1) id(id)
but when I do this I get the message:
26019 total obs.
26019 multiple records at same instant
> PROBABLE ERROR
So I tried dropping the id indicator to avoid having multiple records at the same instant
stset obs, failure(event1)
stdes
But now the output from stdes indicates STATA is treating every observation as an individual and thinks I have >24,000 subjects instead of 490.
Am I going at this the wrong way?
Thanks for your help.
-alison
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/