0

I want to use the IDI.INF function from the survIDINRI package to compare the performance of two Cox regression models using a database of 15000 participants. I used this script:

D=subset(Dataset, select=c("time","status","Var1","Var2","Var3", "Var4", "Var5", "Var6", "Var7", "Var8", "Var9","Var10","Var11","Var12","Var13"))
D$status=as.numeric(D$status==2)
D=D[!is.na(apply(D,1,mean)),] ; dim(D)
Dataset=D[1:15930,]

outcome=D[,c(1,2)]
covs1<-as.matrix(D[,c(-1,-2)])
covs0<-as.matrix(D[,c(-1,-2,-13)])

t0=80
x <- IDI.INF(outcome, covs0, covs1, t0, npert=200)

At the end, I get the following error message:

Error in unoecdf(cc, pdiff[case], Wi[case] * PTB.Vi[case]) : 
  NA/NaN/Inf in foreign function call (arg 5)

Does anyone know what this error message entails? I've tried using different variables and reducing the number of variables I use, as well as changing the time t(0) amongst other things without success.

3 Answers3

0

If your status variable is dichotomous (i.e 0, 1), then change D$status=as.numeric(D$status==2) to D$status=as.numeric(D$status==1).

ttulka
  • 10,309
  • 7
  • 41
  • 52
Sam
  • 1
0

In my case, it was having set up data as a tibble:

# include in IDI.INF help example code to invoke "bug"

library(tibble)  
mydata=as_tibble(mydata)

hmh
  • 1
0

In my case, the problem was solved by omitting NA's from the data.

Kess
  • 101
  • 1