title: I have problem for calculate IDI and NRI with R
body: <p>I'm trying to calculate the integrated discrimination improvement for two Cox regression models (time, event), using the survIDINRI package and the IDI.INF function and I have an error</p>
  <p>This is the code for the function:</p>
  <pre><code>D=subset(donnees,select=c(&quot;time&quot;,&quot;status&quot;,&quot;age&quot;,&quot;smoking&quot;,&quot;hospit_HF&quot;,&quot;symptomatic_angina&quot;,&quot;cardiac2&quot;,&quot;nb_seg_LGE&quot;,&quot;ischemie&quot;))
  D$status=as.numeric(D$status==1 | D$status==2)
  D=D[!is.na(apply(D,1,mean)),] ; dim(D)
  mydata=D
  
  indata2=mydata;
  indata1=mydata[,-8];
  indata0=mydata[,c(-7,-8)];n=nrow(D);
  covs2&lt;-as.matrix(indata2[,c(-1,-2)]);
  covs1&lt;-as.matrix(indata1[,c(-1,-2)]);
  covs0&lt;-as.matrix(indata0[,c(-1,-2)]);
  t0=2
  x&lt;- IDI.INF(mydata[,1:2], covs0, covs1, t0) ;
  </code></pre>
  <p>And I get the following error message:</p>
  <p>Error in unoecdf(cc, pdiff[case], Wi[case] * PTB.Vi[case]) :
  NA/NaN/Inf in foreign function call (arg 5)</p>
  <p>If someone have a solution it's would be great</p>
  <p>Thanks in advance</p>
  <p>Marilyn</p>