I have been trying unsuccessfully to do Net Reclassification Index (NRI) and Integrated Discrimination Improvement (IDI) using the packages “PredictABEL” and “survIDINRI”.
Here I post the code I have been using for the “survIDINRI” one. The idea is to see whether the variable “glst_new” (or gcst_new, grst_new) can improve classification of risk done by the variable “lvef_low”. Let me know if you need any more information about the variables.
I get the following error message:
Error in unoecdf(cc, pdiff[cont], PTB.Vi[cont]) : NA/NaN/Inf in foreign function call (arg 5)
Below the code:
D<- select(ICI_strain_cases, redcap_id, admission_fu_event, cvdeath_vf_shock_chb_arr,
age_ici, sex___1, lvef_low, glst_new, gcst_new, grst_new)
D$cvdeath_vf_shock_chb_arr=as.numeric(D$cvdeath_vf_shock_chb_arr==1)
D=D[!is.na(apply(D,1,mean)),] ; dim(D)
mydata=D[1:75,]
t0=365
indata=select(mydata, admission_fu_event, cvdeath_vf_shock_chb_arr)
indata1=select(mydata, redcap_id:lvef_low)
indata0=select(mydata, redcap_id:sex___1, glst_new)
covs1=as.matrix(indata1[,c(-1, -2, -3)])
covs0=as.matrix(indata0[,c(-1, -2, -3)])
IDI.INF(indata, covs0, covs1, t0, npert = 300, npert.rand = NULL, seed1 = NULL, alpha = 0.05)
Thank you very much
is.na( )
,is.nan( )
andis.infinite( )
, e.g.any(is.na(indata))
.