[R] pooled hazard model with aftreg and time-dependent variables

JPF xpfenech at gmail.com
Sun Aug 21 19:42:07 CEST 2011


Dear R-users,

I have two samples with individuals that are in more than one of the samples
and individuals that are only in one sample. I have been trying to do  a
pooled hazard model, stacking one sample below the other, with aftreg and
time-dependent covariates. The idea behind is to see aggregate effects of
covariates, but need to control for ther effects of same individuals in both
samples and the samples themselves.  


 I created two variables for this purpose: a variable representing
individuals, as a factor, and a variable for each sample, and included them
in the model. I provide an example below. 

If I include the factor sample the analysis works. If I include both sample
+ individual like this: 

>> weibullaft<-aftreg(Surv(sta,time,S) ~ TDC1 + TIC1 + sample + individual,
>> dist="weibull", 
>> data.frame=Data, id=ID) 

, it appears an error with aftreg saying: 

Error in solve.default(fit$hessian) : 
  Lapack routine dgesv: system is exactly singular

With phreg the error is: 

fail in [dsytrf]; info = 14


1 - I am probably doing something wrong. Any suggestion to control for
individuals too would be highly appreciated.

2 - Is including  factor(sample) enough to control for the samples?


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

G 0   0   1  15.96       2               4           7             2               
7
G 1   1   2  15.08       2              4            7             2               
7
H 0   0   1 33.04        2               2            8            2               
8
H 0   1   2 39.97        2               2            8            2               
8 
D 0   0   1 75-34        2               5           9            2                
4
D 0   1   2 76.99        2               5           9              2               
4
E 0   0   1 70.45         2              3            10            2              
5
E 1   1   2 45.01        2               3            10            2              
5
F 0   0   1 35.04        4               2            11            2              
6
F 1   1   2 36.97        4               2            11            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 
Individual - as.factor code for individual 
Sample - as.factor code for sample


thanks,

J


--
View this message in context: http://r.789695.n4.nabble.com/pooled-hazard-model-with-aftreg-and-time-dependent-variables-tp3758805p3758805.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list