[R] Problem with R 2.9.0 vs. R2.8.1 with either "survival" package or "predict" function
Dimitri Liakhovitski
ld7631 at gmail.com
Tue Apr 28 19:04:29 CEST 2009
OK, here we go. I am trying to attach a data file "test.data.txt")
Below is the script:
sample.data<-read.delim(file="test.data.txt")
(dim(sample.data))
(names(sample.data))
names(sample.data)<-c("time","ID","Choice","V1","V2","Set","id")
sample.data$V1<-as.factor(sample.data$V1)
sample.data$V2<-as.factor(sample.data$V2)
library(survival)
### Create a Survival object from the choice data
temp2<-2-sample.data$Choice
DV<-Surv(temp2,sample.data$Choice)
model.test<-coxph(DV~V1:V2+strata(ID),data=sample.data,na.action=na.omit,method="breslow")
totalut<-predict(model.test,newdata=expand.grid(V2=factor(1:5),V1=factor(1:5)))
If you run the last line in R2.8.1 you get "totalut" but if you do it
in R2.9.0 - you get nothing.
Dimitri
On Mon, Apr 27, 2009 at 1:24 PM, Dieter Menne
<dieter.menne at menne-biomed.de> wrote:
> Dimitri Liakhovitski <ld7631 <at> gmail.com> writes:
>
>>
>> Just wanted to alert everyone regarding a problem that I only
>> experience with R2.9.0 and not with R2.8.1 when I run both using
>> exactly the same script and the same data.
>> Here is what I do with my data "MyData", 2 predictors (V1 and V2) and
>> my survival DV "Depvar":
>>
>> library(survival)
>> ....
>
> Make sure that this is really a problem with different versions of R,
> not a problem of different versions of survival which was changed recently,
> without backward compatibility, so that for example many function of
> Design (Harrell) do not work currently.
>
> It would be good if you could post the sessionInfo() for both cases.
>
> Dieter
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Dimitri Liakhovitski
MarketTools, Inc.
Dimitri.Liakhovitski at markettools.com
-------------- next part --------------
"time" "ID" "Choice" "V1" "V2" "Set" "id"
1 1 0 "4" "2" 4101 1
2 1 1 "2" "3" 4202 1
3 1 0 "5" "4" 4303 1
4 1 1 "1" "2" 4104 1
5 1 0 "2" "3" 4205 1
6 1 0 "3" "5" 4306 1
7 1 1 "1" "1" 4107 1
8 1 0 "4" "4" 4208 1
9 1 0 "3" "5" 4309 1
10 1 1 "1" "1" 4110 1
11 1 0 "5" "2" 4211 1
12 1 0 "2" "3" 4312 1
13 1 0 "4" "3" 4113 1
14 1 0 "3" "4" 4214 1
15 1 1 "2" "5" 4315 1
1 2 0 "1" "1" 3101 2
2 2 1 "2" "2" 3202 2
3 2 0 "5" "5" 3303 2
4 2 1 "3" "1" 3104 2
5 2 0 "5" "2" 3205 2
6 2 0 "4" "5" 3306 2
7 2 0 "2" "1" 3107 2
8 2 0 "1" "2" 3208 2
9 2 1 "4" "3" 3309 2
10 2 1 "4" "1" 3110 2
11 2 0 "1" "3" 3211 2
12 2 0 "2" "5" 3312 2
13 2 1 "4" "1" 3113 2
14 2 0 "1" "3" 3214 2
15 2 0 "5" "4" 3315 2
1 3 1 "2" "2" 1101 3
2 3 0 "5" "3" 1202 3
3 3 0 "4" "4" 1303 3
4 3 1 "5" "1" 1104 3
5 3 0 "3" "4" 1205 3
6 3 0 "1" "5" 1306 3
7 3 0 "3" "3" 1107 3
8 3 1 "5" "4" 1208 3
9 3 0 "4" "5" 1309 3
10 3 1 "5" "1" 1110 3
11 3 0 "3" "2" 1211 3
12 3 0 "1" "4" 1312 3
13 3 1 "2" "1" 1113 3
14 3 0 "3" "3" 1214 3
15 3 0 "1" "4" 1315 3
1 4 0 "3" "1" 2101 4
2 4 0 "4" "2" 2202 4
3 4 1 "2" "4" 2303 4
4 4 0 "4" "3" 2104 4
5 4 0 "3" "4" 2205 4
6 4 1 "5" "5" 2306 4
7 4 0 "3" "2" 2107 4
8 4 1 "2" "4" 2208 4
9 4 0 "5" "5" 2309 4
10 4 1 "2" "2" 2110 4
11 4 0 "5" "3" 2211 4
12 4 0 "3" "5" 2312 4
13 4 1 "5" "2" 2113 4
14 4 0 "4" "4" 2214 4
15 4 0 "1" "5" 2315 4
1 5 0 "3" "1" 2101 5
2 5 1 "4" "2" 2202 5
3 5 0 "2" "4" 2303 5
4 5 1 "4" "3" 2104 5
5 5 0 "3" "4" 2205 5
6 5 0 "5" "5" 2306 5
7 5 1 "3" "2" 2107 5
8 5 0 "2" "4" 2208 5
9 5 0 "5" "5" 2309 5
10 5 0 "2" "2" 2110 5
11 5 0 "5" "3" 2211 5
12 5 1 "3" "5" 2312 5
13 5 0 "5" "2" 2113 5
14 5 1 "4" "4" 2214 5
15 5 0 "1" "5" 2315 5
1 6 0 "1" "1" 3101 6
2 6 1 "2" "2" 3202 6
3 6 0 "5" "5" 3303 6
4 6 0 "3" "1" 3104 6
5 6 0 "5" "2" 3205 6
6 6 1 "4" "5" 3306 6
7 6 0 "2" "1" 3107 6
8 6 0 "1" "2" 3208 6
9 6 1 "4" "3" 3309 6
10 6 0 "4" "1" 3110 6
11 6 1 "1" "3" 3211 6
12 6 0 "2" "5" 3312 6
13 6 1 "4" "1" 3113 6
14 6 0 "1" "3" 3214 6
15 6 0 "5" "4" 3315 6
1 7 0 "4" "2" 4101 7
2 7 1 "2" "3" 4202 7
3 7 0 "5" "4" 4303 7
4 7 1 "1" "2" 4104 7
5 7 0 "2" "3" 4205 7
6 7 0 "3" "5" 4306 7
7 7 1 "1" "1" 4107 7
8 7 0 "4" "4" 4208 7
9 7 0 "3" "5" 4309 7
10 7 0 "1" "1" 4110 7
11 7 1 "5" "2" 4211 7
12 7 0 "2" "3" 4312 7
13 7 0 "4" "3" 4113 7
14 7 0 "3" "4" 4214 7
15 7 0 "2" "5" 4315 7
1 8 1 "2" "2" 1101 8
2 8 0 "5" "3" 1202 8
3 8 0 "4" "4" 1303 8
4 8 1 "5" "1" 1104 8
5 8 0 "3" "4" 1205 8
6 8 0 "1" "5" 1306 8
7 8 0 "3" "3" 1107 8
8 8 1 "5" "4" 1208 8
9 8 0 "4" "5" 1309 8
10 8 1 "5" "1" 1110 8
11 8 0 "3" "2" 1211 8
12 8 0 "1" "4" 1312 8
13 8 1 "2" "1" 1113 8
14 8 0 "3" "3" 1214 8
15 8 0 "1" "4" 1315 8
1 9 0 "4" "2" 4101 9
2 9 1 "2" "3" 4202 9
3 9 0 "5" "4" 4303 9
4 9 0 "1" "2" 4104 9
5 9 1 "2" "3" 4205 9
6 9 0 "3" "5" 4306 9
7 9 0 "1" "1" 4107 9
8 9 0 "4" "4" 4208 9
9 9 0 "3" "5" 4309 9
10 9 0 "1" "1" 4110 9
11 9 0 "5" "2" 4211 9
12 9 0 "2" "3" 4312 9
13 9 0 "4" "3" 4113 9
14 9 0 "3" "4" 4214 9
15 9 0 "2" "5" 4315 9
1 10 0 "3" "1" 2101 10
2 10 1 "4" "2" 2202 10
3 10 0 "2" "4" 2303 10
4 10 0 "4" "3" 2104 10
5 10 0 "3" "4" 2205 10
6 10 0 "5" "5" 2306 10
7 10 0 "3" "2" 2107 10
8 10 0 "2" "4" 2208 10
9 10 0 "5" "5" 2309 10
10 10 0 "2" "2" 2110 10
11 10 0 "5" "3" 2211 10
12 10 0 "3" "5" 2312 10
13 10 0 "5" "2" 2113 10
14 10 0 "4" "4" 2214 10
15 10 0 "1" "5" 2315 10
1 11 1 "1" "1" 3101 11
2 11 0 "2" "2" 3202 11
3 11 0 "5" "5" 3303 11
4 11 0 "3" "1" 3104 11
5 11 1 "5" "2" 3205 11
6 11 0 "4" "5" 3306 11
7 11 1 "2" "1" 3107 11
8 11 0 "1" "2" 3208 11
9 11 0 "4" "3" 3309 11
10 11 0 "4" "1" 3110 11
11 11 1 "1" "3" 3211 11
12 11 0 "2" "5" 3312 11
13 11 1 "4" "1" 3113 11
14 11 0 "1" "3" 3214 11
15 11 0 "5" "4" 3315 11
1 12 0 "1" "1" 3101 12
2 12 0 "2" "2" 3202 12
3 12 1 "5" "5" 3303 12
4 12 0 "3" "1" 3104 12
5 12 1 "5" "2" 3205 12
6 12 0 "4" "5" 3306 12
7 12 0 "2" "1" 3107 12
8 12 0 "1" "2" 3208 12
9 12 1 "4" "3" 3309 12
10 12 0 "4" "1" 3110 12
11 12 0 "1" "3" 3211 12
12 12 1 "2" "5" 3312 12
13 12 0 "4" "1" 3113 12
14 12 0 "1" "3" 3214 12
15 12 1 "5" "4" 3315 12
1 13 1 "2" "2" 1101 13
2 13 0 "5" "3" 1202 13
3 13 0 "4" "4" 1303 13
4 13 1 "5" "1" 1104 13
5 13 0 "3" "4" 1205 13
6 13 0 "1" "5" 1306 13
7 13 0 "3" "3" 1107 13
8 13 0 "5" "4" 1208 13
9 13 1 "4" "5" 1309 13
10 13 1 "5" "1" 1110 13
11 13 0 "3" "2" 1211 13
12 13 0 "1" "4" 1312 13
13 13 1 "2" "1" 1113 13
14 13 0 "3" "3" 1214 13
15 13 0 "1" "4" 1315 13
1 14 1 "4" "2" 4101 14
2 14 0 "2" "3" 4202 14
3 14 0 "5" "4" 4303 14
4 14 0 "1" "2" 4104 14
5 14 0 "2" "3" 4205 14
6 14 0 "3" "5" 4306 14
7 14 0 "1" "1" 4107 14
8 14 1 "4" "4" 4208 14
9 14 0 "3" "5" 4309 14
10 14 1 "1" "1" 4110 14
11 14 0 "5" "2" 4211 14
12 14 0 "2" "3" 4312 14
13 14 0 "4" "3" 4113 14
14 14 0 "3" "4" 4214 14
15 14 0 "2" "5" 4315 14
1 15 1 "1" "1" 3101 15
2 15 0 "2" "2" 3202 15
3 15 0 "5" "5" 3303 15
4 15 0 "3" "1" 3104 15
5 15 0 "5" "2" 3205 15
6 15 0 "4" "5" 3306 15
7 15 0 "2" "1" 3107 15
8 15 0 "1" "2" 3208 15
9 15 0 "4" "3" 3309 15
10 15 0 "4" "1" 3110 15
11 15 0 "1" "3" 3211 15
12 15 0 "2" "5" 3312 15
13 15 0 "4" "1" 3113 15
14 15 0 "1" "3" 3214 15
15 15 0 "5" "4" 3315 15
1 16 0 "1" "1" 3101 16
2 16 1 "2" "2" 3202 16
3 16 0 "5" "5" 3303 16
4 16 0 "3" "1" 3104 16
5 16 1 "5" "2" 3205 16
6 16 0 "4" "5" 3306 16
7 16 0 "2" "1" 3107 16
8 16 1 "1" "2" 3208 16
9 16 0 "4" "3" 3309 16
10 16 1 "4" "1" 3110 16
11 16 0 "1" "3" 3211 16
12 16 0 "2" "5" 3312 16
13 16 0 "4" "1" 3113 16
14 16 1 "1" "3" 3214 16
15 16 0 "5" "4" 3315 16
1 17 0 "3" "1" 2101 17
2 17 0 "4" "2" 2202 17
3 17 1 "2" "4" 2303 17
4 17 0 "4" "3" 2104 17
5 17 0 "3" "4" 2205 17
6 17 1 "5" "5" 2306 17
7 17 0 "3" "2" 2107 17
8 17 1 "2" "4" 2208 17
9 17 0 "5" "5" 2309 17
10 17 1 "2" "2" 2110 17
11 17 0 "5" "3" 2211 17
12 17 0 "3" "5" 2312 17
13 17 1 "5" "2" 2113 17
14 17 0 "4" "4" 2214 17
15 17 0 "1" "5" 2315 17
1 18 0 "4" "2" 4101 18
2 18 1 "2" "3" 4202 18
3 18 0 "5" "4" 4303 18
4 18 0 "1" "2" 4104 18
5 18 1 "2" "3" 4205 18
6 18 0 "3" "5" 4306 18
7 18 1 "1" "1" 4107 18
8 18 0 "4" "4" 4208 18
9 18 0 "3" "5" 4309 18
10 18 1 "1" "1" 4110 18
11 18 0 "5" "2" 4211 18
12 18 0 "2" "3" 4312 18
13 18 0 "4" "3" 4113 18
14 18 0 "3" "4" 4214 18
15 18 0 "2" "5" 4315 18
1 19 0 "2" "2" 1101 19
2 19 1 "5" "3" 1202 19
3 19 0 "4" "4" 1303 19
4 19 0 "5" "1" 1104 19
5 19 1 "3" "4" 1205 19
6 19 0 "1" "5" 1306 19
7 19 1 "3" "3" 1107 19
8 19 0 "5" "4" 1208 19
9 19 0 "4" "5" 1309 19
10 19 0 "5" "1" 1110 19
11 19 1 "3" "2" 1211 19
12 19 0 "1" "4" 1312 19
13 19 0 "2" "1" 1113 19
14 19 1 "3" "3" 1214 19
15 19 0 "1" "4" 1315 19
1 20 0 "3" "1" 2101 20
2 20 0 "4" "2" 2202 20
3 20 1 "2" "4" 2303 20
4 20 0 "4" "3" 2104 20
5 20 0 "3" "4" 2205 20
6 20 1 "5" "5" 2306 20
7 20 0 "3" "2" 2107 20
8 20 0 "2" "4" 2208 20
9 20 1 "5" "5" 2309 20
10 20 0 "2" "2" 2110 20
11 20 1 "5" "3" 2211 20
12 20 0 "3" "5" 2312 20
13 20 1 "5" "2" 2113 20
14 20 0 "4" "4" 2214 20
15 20 0 "1" "5" 2315 20
1 21 1 "2" "2" 1101 21
2 21 0 "5" "3" 1202 21
3 21 0 "4" "4" 1303 21
4 21 0 "5" "1" 1104 21
5 21 1 "3" "4" 1205 21
6 21 0 "1" "5" 1306 21
7 21 1 "3" "3" 1107 21
8 21 0 "5" "4" 1208 21
9 21 0 "4" "5" 1309 21
10 21 0 "5" "1" 1110 21
11 21 1 "3" "2" 1211 21
12 21 0 "1" "4" 1312 21
13 21 0 "2" "1" 1113 21
14 21 1 "3" "3" 1214 21
15 21 0 "1" "4" 1315 21
1 22 0 "2" "2" 1101 22
2 22 1 "5" "3" 1202 22
3 22 0 "4" "4" 1303 22
4 22 0 "5" "1" 1104 22
5 22 1 "3" "4" 1205 22
6 22 0 "1" "5" 1306 22
7 22 1 "3" "3" 1107 22
8 22 0 "5" "4" 1208 22
9 22 0 "4" "5" 1309 22
10 22 0 "5" "1" 1110 22
11 22 1 "3" "2" 1211 22
12 22 0 "1" "4" 1312 22
13 22 0 "2" "1" 1113 22
14 22 1 "3" "3" 1214 22
15 22 0 "1" "4" 1315 22
1 23 1 "1" "1" 3101 23
2 23 0 "2" "2" 3202 23
3 23 0 "5" "5" 3303 23
4 23 0 "3" "1" 3104 23
5 23 1 "5" "2" 3205 23
6 23 0 "4" "5" 3306 23
7 23 0 "2" "1" 3107 23
8 23 1 "1" "2" 3208 23
9 23 0 "4" "3" 3309 23
10 23 0 "4" "1" 3110 23
11 23 1 "1" "3" 3211 23
12 23 0 "2" "5" 3312 23
13 23 1 "4" "1" 3113 23
14 23 0 "1" "3" 3214 23
15 23 0 "5" "4" 3315 23
1 24 0 "3" "1" 2101 24
2 24 0 "4" "2" 2202 24
3 24 1 "2" "4" 2303 24
4 24 0 "4" "3" 2104 24
5 24 0 "3" "4" 2205 24
6 24 0 "5" "5" 2306 24
7 24 0 "3" "2" 2107 24
8 24 1 "2" "4" 2208 24
9 24 0 "5" "5" 2309 24
10 24 1 "2" "2" 2110 24
11 24 0 "5" "3" 2211 24
12 24 0 "3" "5" 2312 24
13 24 1 "5" "2" 2113 24
14 24 0 "4" "4" 2214 24
15 24 0 "1" "5" 2315 24
1 25 1 "4" "2" 4101 25
2 25 0 "2" "3" 4202 25
3 25 0 "5" "4" 4303 25
4 25 0 "1" "2" 4104 25
5 25 1 "2" "3" 4205 25
6 25 0 "3" "5" 4306 25
7 25 0 "1" "1" 4107 25
8 25 1 "4" "4" 4208 25
9 25 0 "3" "5" 4309 25
10 25 0 "1" "1" 4110 25
11 25 1 "5" "2" 4211 25
12 25 0 "2" "3" 4312 25
13 25 1 "4" "3" 4113 25
14 25 0 "3" "4" 4214 25
15 25 0 "2" "5" 4315 25
1 26 0 "1" "1" 3101 26
2 26 1 "2" "2" 3202 26
3 26 0 "5" "5" 3303 26
4 26 1 "3" "1" 3104 26
5 26 0 "5" "2" 3205 26
6 26 0 "4" "5" 3306 26
7 26 0 "2" "1" 3107 26
8 26 0 "1" "2" 3208 26
9 26 1 "4" "3" 3309 26
10 26 1 "4" "1" 3110 26
11 26 0 "1" "3" 3211 26
12 26 0 "2" "5" 3312 26
13 26 1 "4" "1" 3113 26
14 26 0 "1" "3" 3214 26
15 26 0 "5" "4" 3315 26
1 27 0 "4" "2" 4101 27
2 27 0 "2" "3" 4202 27
3 27 0 "5" "4" 4303 27
4 27 0 "1" "2" 4104 27
5 27 0 "2" "3" 4205 27
6 27 0 "3" "5" 4306 27
7 27 1 "1" "1" 4107 27
8 27 0 "4" "4" 4208 27
9 27 0 "3" "5" 4309 27
10 27 0 "1" "1" 4110 27
11 27 0 "5" "2" 4211 27
12 27 1 "2" "3" 4312 27
13 27 0 "4" "3" 4113 27
14 27 0 "3" "4" 4214 27
15 27 0 "2" "5" 4315 27
1 28 0 "1" "1" 3101 28
2 28 0 "2" "2" 3202 28
3 28 0 "5" "5" 3303 28
4 28 0 "3" "1" 3104 28
5 28 0 "5" "2" 3205 28
6 28 0 "4" "5" 3306 28
7 28 0 "2" "1" 3107 28
8 28 0 "1" "2" 3208 28
9 28 0 "4" "3" 3309 28
10 28 0 "4" "1" 3110 28
11 28 0 "1" "3" 3211 28
12 28 0 "2" "5" 3312 28
13 28 0 "4" "1" 3113 28
14 28 0 "1" "3" 3214 28
15 28 0 "5" "4" 3315 28
1 29 0 "3" "1" 2101 29
2 29 1 "4" "2" 2202 29
3 29 0 "2" "4" 2303 29
4 29 1 "4" "3" 2104 29
5 29 0 "3" "4" 2205 29
6 29 0 "5" "5" 2306 29
7 29 0 "3" "2" 2107 29
8 29 0 "2" "4" 2208 29
9 29 0 "5" "5" 2309 29
10 29 1 "2" "2" 2110 29
11 29 0 "5" "3" 2211 29
12 29 0 "3" "5" 2312 29
13 29 0 "5" "2" 2113 29
14 29 1 "4" "4" 2214 29
15 29 0 "1" "5" 2315 29
1 30 0 "1" "1" 3101 30
2 30 1 "2" "2" 3202 30
3 30 0 "5" "5" 3303 30
4 30 0 "3" "1" 3104 30
5 30 1 "5" "2" 3205 30
6 30 0 "4" "5" 3306 30
7 30 1 "2" "1" 3107 30
8 30 0 "1" "2" 3208 30
9 30 0 "4" "3" 3309 30
10 30 0 "4" "1" 3110 30
11 30 1 "1" "3" 3211 30
12 30 0 "2" "5" 3312 30
13 30 0 "4" "1" 3113 30
14 30 1 "1" "3" 3214 30
15 30 0 "5" "4" 3315 30
1 31 0 "4" "2" 4101 31
2 31 1 "2" "3" 4202 31
3 31 0 "5" "4" 4303 31
4 31 0 "1" "2" 4104 31
5 31 1 "2" "3" 4205 31
6 31 0 "3" "5" 4306 31
7 31 1 "1" "1" 4107 31
8 31 0 "4" "4" 4208 31
9 31 0 "3" "5" 4309 31
10 31 0 "1" "1" 4110 31
11 31 1 "5" "2" 4211 31
12 31 0 "2" "3" 4312 31
13 31 0 "4" "3" 4113 31
14 31 0 "3" "4" 4214 31
15 31 1 "2" "5" 4315 31
1 32 0 "1" "1" 3101 32
2 32 1 "2" "2" 3202 32
3 32 0 "5" "5" 3303 32
4 32 0 "3" "1" 3104 32
5 32 0 "5" "2" 3205 32
6 32 0 "4" "5" 3306 32
7 32 0 "2" "1" 3107 32
8 32 0 "1" "2" 3208 32
9 32 1 "4" "3" 3309 32
10 32 1 "4" "1" 3110 32
11 32 0 "1" "3" 3211 32
12 32 0 "2" "5" 3312 32
13 32 0 "4" "1" 3113 32
14 32 1 "1" "3" 3214 32
15 32 0 "5" "4" 3315 32
1 33 1 "2" "2" 1101 33
2 33 0 "5" "3" 1202 33
3 33 0 "4" "4" 1303 33
4 33 1 "5" "1" 1104 33
5 33 0 "3" "4" 1205 33
6 33 0 "1" "5" 1306 33
7 33 0 "3" "3" 1107 33
8 33 1 "5" "4" 1208 33
9 33 0 "4" "5" 1309 33
10 33 1 "5" "1" 1110 33
11 33 0 "3" "2" 1211 33
12 33 0 "1" "4" 1312 33
13 33 1 "2" "1" 1113 33
14 33 0 "3" "3" 1214 33
15 33 0 "1" "4" 1315 33
1 34 0 "4" "2" 4101 34
2 34 1 "2" "3" 4202 34
3 34 0 "5" "4" 4303 34
4 34 1 "1" "2" 4104 34
5 34 0 "2" "3" 4205 34
More information about the R-help
mailing list