Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Is it possible to estimate the cumulative incidence function using stpm2cif when you have competing risks and time-varying covariates?


From   Steve Samuels <sjsamuels@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Is it possible to estimate the cumulative incidence function using stpm2cif when you have competing risks and time-varying covariates?
Date   Sun, 23 Sep 2012 09:38:20 -0400

You are asked in the FAQ to give the source of non-official commands.
Both -stpm2- and -stpm2cif- are from SSC. Also "STATA" is not correct
spelling for "Stata".

The example in the -help- for -stpm2cif- uses expanded data after "stset
time, fail(failure)". So expanded data per se is not a problem. 

Unfortunately, -stpm2cif- will not work properly if the original data
set has time-dependent covariates, as yours does. Such data has multiple
records per subject before expansion, so the expanded data set does not
weight each subject properly.

The value of CIFs (or baseline survival curves) with time-dependent
covariates would be questionable anyway. These estimated curves represent a
population in which covariate values do not vary with time. Such a
population might be quite atypical.

Steve



On Sep 22, 2012, at 8:24 PM, Turnbull, Alison E. wrote:

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/


*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index