[R] AFT model time-dependent with weibull distribution

hafida hafida-06 at hotmail.fr
Sat Aug 4 19:45:11 CEST 2012


Dear R-community, 
> 
> I have tried to estimate an EXPONENTIEL accelerated failure time(AFT)
> power rule model  with time-independent . For that purpose, I have used
> the eha package. 
> Please, consider this example: 

  vi      Ti
1  26    5.79
2  26 1579.52
3  26 2323.70
4  28   68.85
5  28  426.07
6  28  110.29
7  28  108.29
8  28 1067.60
9  30   17.05
10 30   22.66
11 30   21.02
12 30  175.88
13 30  139.07
14 30  144.12
15 30   20.46
16 30   43.40
17 30  194.90
18 30   47.30
19 30    7.74
20 32    0.40
21 32   82.85
22 32    9.88
23 32   89.29
24 32  215.10
25 32    1.75
26 32    0.79
27 32   15.93
28 32    3.91
29 32    0.27
30 32    0.69
31 32  100.58
32 32   27.80
33 32   13.95
34 32   53.24
35 34    0.96
36 34    4.15
37 34    0.19
38 34    0.78
39 34    8.01
40 34   31.75
41 34    7.35
42 34    6.50
43 34    8.27
44 34   33.91
45 34   32.52
46 34    3.16
47 34    4.85
48 34    2.78
49 34    4.67
50 34    1.31
51 34   12.06
52 34   36.71
53 34   72.89
54 36    1.97
55 36    0.59
56 36    2.58
57 36    1.69
58 36    2.71
59 36   25.50
60 36    0.35
61 36    0.99
62 36    3.99
63 36    3.67
64 36    2.07
65 36    0.96
66 36    5.35
67 36    2.90
68 36   13.77
69 38    0.47
70 38    0.73
71 38    1.40
72 38    0.74
73 38    0.39
74 38    1.13
75 38    0.09
76 38    2.38
> aftexp<-aftreg(Surv(time,status) ~ vi,  data=data.frame(dataexp),
> dist="exponentiel")
Error in Surv(time, status) : Time variable is not numeric

> aftexp<-aftreg(Surv(Ti,status) ~ vi,  data=data.frame(dataexp),
> dist="exponentiel")
Error in Surv(Ti, status) : object 'status' not found
> status<- rep(1, 76)
> status
 [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1
[39] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1

> cbind(dataexp, status)
   vi      Ti status
1  26    5.79      1
2  26 1579.52      1
3  26 2323.70      1
4  28   68.85      1
5  28  426.07      1
6  28  110.29      1
7  28  108.29      1
8  28 1067.60      1
9  30   17.05      1
10 30   22.66      1
11 30   21.02      1
12 30  175.88      1
13 30  139.07      1
14 30  144.12      1
15 30   20.46      1
16 30   43.40      1
17 30  194.90      1
18 30   47.30      1
19 30    7.74      1
20 32    0.40      1
21 32   82.85      1
22 32    9.88      1
23 32   89.29      1
24 32  215.10      1
25 32    1.75      1
26 32    0.79      1
27 32   15.93      1
28 32    3.91      1
29 32    0.27      1
30 32    0.69      1
31 32  100.58      1
32 32   27.80      1
33 32   13.95      1
34 32   53.24      1
35 34    0.96      1
36 34    4.15      1
37 34    0.19      1
38 34    0.78      1
39 34    8.01      1
40 34   31.75      1
41 34    7.35      1
42 34    6.50      1
43 34    8.27      1
44 34   33.91      1
45 34   32.52      1
46 34    3.16      1
47 34    4.85      1
48 34    2.78      1
49 34    4.67      1
50 34    1.31      1
51 34   12.06      1
52 34   36.71      1
53 34   72.89      1
54 36    1.97      1
55 36    0.59      1
56 36    2.58      1
57 36    1.69      1
58 36    2.71      1
59 36   25.50      1
60 36    0.35      1
61 36    0.99      1
62 36    3.99      1
63 36    3.67      1
64 36    2.07      1
65 36    0.96      1
66 36    5.35      1
67 36    2.90      1
68 36   13.77      1
69 38    0.47      1
70 38    0.73      1
71 38    1.40      1
72 38    0.74      1
73 38    0.39      1
74 38    1.13      1
75 38    0.09      1
76 38    2.38      1

> aftexp<-aftreg(Surv(Ti,status) ~ vi,  data=data.frame(dataexp),
> dist="exponentiel")
Error in aftreg.fit(X, Y, dist, strats, offset, init, shape, id, control,  : 
  exponentiel is not an implemented distribution

> aftexp<-aftreg(Surv(time,status) ~ vi,  data=data.frame(dataexp),
> dist="exponentiel")
Error in Surv(time, status) : Time variable is not numeric
> pleas help me to find a solution to my problem




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



More information about the R-help mailing list