Bookmark and Share

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]

Re: st: Survival analysis question


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: st: Survival analysis question
Date   Wed, 3 Nov 2010 15:39:43 -0400

--


Al,

I don't think that the two times are consecutive: they are recorded as seconds, but the the two observations on each subject were separated by a week.

Steve

On Nov 3, 2010, at 2:50 PM, Feiveson, Alan H. (JSC-SK311) wrote:

Steve - In my opinion this is multiple failure data. Each subject is subjected to two consecutive exposures, and a subject can "fail" on none, either, or both of these tests. So the variable ttrxt at a given observation is the total time that the particular subject has been at risk up through that observation. Therefore I think the stset command

. stset ttrxt, id(id) failure(fail) exit(time .)

               id:  id
    failure event:  fail != 0 & fail < .
obs. time interval:  (ttrxt[_n-1], ttrxt]
exit on or before:  time .

------------------------------------------------------------------------------
      16  total obs.
       0  exclusions
------------------------------------------------------------------------------
      16  obs. remaining, representing
       8  subjects
      13  failures in multiple failure-per-subject data
    5607  total analysis time at risk, at risk from t =         0
                            earliest observed entry t =         0
                                 last observed exit t =      1198

is correct. I agree that ideally, one should try a frailty model on this data, but it doesn't work well with only 8 subjects.

Al Feiveson




-----Original Message-----
From: [email protected] [mailto:[email protected] ] On Behalf Of Steven Samuels
Sent: Wednesday, November 03, 2010 12:35 PM
To: [email protected]
Subject: Re: st: Survival analysis question


Chris Westby:


You don't have multiple-failure data, because the start time for the
two tests should be zero. The correct statement is:

stset t, failure(fail)

This will change the -stcox- results as well. Also try -stsum,
by(treatment)- after the two versions of -stset--.  I suggest that you
consider the -shared-  option in -stcox- to allow for the possibility
of person-specific baseline hazards. Note that eight subjects is
probably not enough for the standard errors to be reliable.


Steve

Steven J. Samuels
[email protected]
18 Cantine's Island
Saugerties NY 12477
USA
Voice: 845-246-0774
Fax:    206-202-4783


On Nov 3, 2010, at 8:35 AM, Westby, Christian Michael. (JSC-SK)[USRA]
wrote:

Dear Statalisters,

I am working on comparing survival times in one group of subjects
before and after treatment and am having a hard time with the "stset"
code.


Using the following data set where testing was separated by 1 week, t
is time of task before and after treatment (seconds) and ttrxt is time
calculated to prevent time from being treated as continuous and fail
is 0=completed, 1=not completed.



subjectid	treatment	fail			t	ttrxt
-----------------------------------------------------------------
1		pre		failed		169	169
1		post		failed		141	310
2		pre		failed		114	114
2		post		failed		84	198
3		pre		failed		564	564
3		post		failed		296	860
4		pre		failed		168	168
4		post		failed		332	500
5		pre		failed		215	215
5		post		failed		50	265
6		pre		completed		900	900
6		post		failed		196	1096
7		pre		completed		900	900
7		post		failed		298	1198
8		pre		completed		900	900
8		post		failed		280	1180
-----------------------------------------------------------------


I used


. stset ttrxt, id(subjectid) failure(fail) exit(time .)


id:  subjectid
failure event:  fail != 0 & fail < .
obs. time interval:  (ttrxt[_n-1], ttrxt]  exit on or before:  time .

------------------------------------------------------------------------------
      16  total obs.
       0  exclusions
------------------------------------------------------------------------------
      16  obs. remaining, representing
       8  subjects
      13  failures in multiple failure-per-subject data
    5607  total analysis time at risk, at risk from t =         0
                            earliest observed entry t =         0
                                 last observed exit t =      1198


I then ran


. stcox treatment, cluster(subjectid)

        failure _d:  fail
  analysis time _t:  ttrxt
 exit on or before:  time .
                id:  subjectid

Iteration 0:   log pseudolikelihood = -20.175132
Iteration 1:   log pseudolikelihood = -18.079165
Iteration 2:   log pseudolikelihood = -18.026011
Iteration 3:   log pseudolikelihood = -18.025935
Refining estimates:
Iteration 0:   log pseudolikelihood = -18.025935

Cox regression -- no ties

No. of subjects      =            8                Number of obs
=        16
No. of failures      =           13
Time at risk         =         5607
                                                  Wald chi2(1)
=      4.22
Log pseudolikelihood =   -18.025935                Prob > chi2
=    0.0399

                             (Std. Err. adjusted for 8 clusters in
subjectid)
------------------------------------------------------------------------------
            |               Robust
         _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+----------------------------------------------------------
-------------+------
  treatment |   4.610013   3.428317     2.05   0.040     1.073226
19.80218
------------------------------------------------------------------------------


I believe that the output and results are accurate however, I am
unable to get Stata to correctly graph the survival curves using the
following code



. stcurv, surv at1(treatment=0) at2(treatment=1)


the resulting graph incorrectly plots both groups starting at less
than 100% at a time=0 and the x-axis scale is incorrect.


Any thoughts?



Chris


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

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index