我想使用survIDINRI包中的IDI.INF函数来表现两个Cox回归模型。 为此,我使用了以下脚本:
> D=subset(Dataset, select=c("time","status","Var1","Var2","Var3", "Var4", "Var5", "Var6", "Var7", "Var8"))
> D$status=as.numeric(D$status==2)
> D=D[!is.na(apply(D,1,mean)),] ; dim(D)
[1] 800 10
> head(D)
> outcome=D[,c(1,2)]
> covs1<-as.matrix(D[,c(-1,-2)])
> covs0<-as.matrix(D[,c(-1,-2, -10)])
> head(outcome)
> head(covs0)
> head(covs1)
> x <-IDI.INF(outcome, covs0, covs1, t0, npert=300,npert.rand = NULL, seed1 = NULL, alpha = 0.05)
最后,我收到以下消息:
Error in fitter(X, Y, strats, offset, init, control, weights = weights, :
NA/NaN/Inf in foreign function call (arg 6)
In addition: Warning message:
In fitter(X, Y, strats, offset, init, control, weights = weights, :
Ran out of iterations and did not converge
是否有人有过使用此IDI.INF功能的经验?有办法解决这个问题吗?
答案 0 :(得分:0)
由于一个变量的预测值较弱(可能是data.frame中的第6个变量),因此可能会遇到此错误消息。您可以通过删除该变量或包括更多研究主题的方式来解决此问题,以使预测模型稳定。