[R] AFT model time-dependent with weibull distribution

JPF xpfenech at gmail.com
Sat Aug 20 02:28:23 CEST 2011


Dear Prof. Broström,

 I have searched in the reference manual inside the package eha, updated
recently. I did not find any description on how to enter id in the aftreg
function except the description of the argument. Can you refer to a specific
part of the manual?  Do you mean another documentation?


I had also visited the posting guide before ( I included an example and all
the details I could.). What else can I add?

And have also read a a book intruducing survival analysis in R, but the
doubt that I have is very specific to R computation. 


I reask the questions: 

I have a doubt on how to perform a weibull parametric survival anayisis
using time-dependent covariates in R using both accelerated failure
time(AFT) and proportional hazard (PH).

I would highly appreciate a reply to my questions. 

I provide an example similar to data i use. (Here there are only two
covariates one dependent and another independent)

Data 
   S sta time  TDC1 total_time TIC1          ID 
A 1   0   1  48.50       1              1           1 
B 0   0   1  65.96       2               1           2 
B 1   1   2  65.08       2              1            2 
C 0   0   1  0.00        2               4           3 
C 1   1   2  0.00        2               4           3 
D 0   0   1 72.74        2               5           4 
D 1   1   2 72.52        2               5           4 
E 0   0   1 61.84         2              3            5 
E 0   1   2 60.56        2               3            5 
F 0   0   1 35.04        4               2            6 
F 0   1   2 36.97        4               2            6 
F 0   2   3 37.92        4               2            6 
F 1   3   4 39.01        4               2            6 

time - time to event 
sta - starting time 
TDC - time dependent covariates 
TIC - time independent covariate 
total_time - total time at risk 
ID - ID 

Doubts:  

-AFT and PH time-dependent Weibull distribution

I have tried to estimate an accelerated failure time(AFT) and proportional
hazard (PH) parametric survival model with time-independent  and
time-dependent covariates with a weibull distribution. For that purpose, I
have used the eha  package. To my knowledge, the survival package does not
provide a solution for estimating models with time-dependent models.

weibullph <- phreg(Surv(sta,time,S) ~ TDC1 + TIC1, dist="weibull",
data.frame=Data)   
weibullaft<-aftreg(Surv(sta,time,S) ~ TDC1 + TIC1, dist="weibull",
data.frame=Data) 

## aftreg gives an error when I add an ID argument... That should be used
for controlling for time-varying variables.

Error in aftreg.fit(X, Y, dist, strats, offset, init, shape, id, control,  : 
  *Overlapping intervals for id  2 *
  
>From help(aftreg): id If there are more than one spell per individual, it is
essential to keep spells together by the id argument. This allows for
time-varying covariates. 

Here are the questions I have: 
 
1- How can I solve this error? 
2- Does the phreg function need an ID?  Can I use it to estimate  a model
with time-dependent covariates? 
3- How can time-dependent covariates be estimated with phreg or aftreg, or
other function in R?


Thank you very much,

J

--
View this message in context: http://r.789695.n4.nabble.com/AFT-model-time-dependent-with-weibull-distribution-tp3755079p3756424.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list