Skip to content
Prev 178705 / 398506 Next

Problem with R 2.9.0 vs. R2.8.1 with either "survival" package or "predict" function

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: