title: C-statistics and 95% confidence interval for Cox-model with time-dependent covariates
body: <p>I am performing Cox regression with a time-dependent covariate. I´m specifically interested in calculating the 95% confidence interval of the Concordance index. The standard summary of the coxph model however only returns the Concordance index and its standard error. Is there any possibility to also get the 95% CI?</p>
  
  <p>Thanks!</p>
  
  <pre><code>library(survival)
  
  temp &lt;- subset(pbc, id &lt;= 312, select=c(id:sex, stage))
  pbc2 &lt;- tmerge(temp, temp, id=id, death = event(time, status)) #set range
  pbc2 &lt;- tmerge(pbc2, pbcseq, id=id, ascites = tdc(day, ascites),
  bili = tdc(day, bili), albumin = tdc(day, albumin),
  protime = tdc(day, protime), alk.phos = tdc(day, alk.phos))
  fit2 &lt;- coxph(Surv(tstart, tstop, death==2) ~ log(bili) + log(protime), pbc2)
  
  summary(fit2)
  
  coxph(formula = Surv(tstart, tstop, death == 2) ~ log(bili) + 
      log(protime), data = pbc2)
  
    n= 1807, number of events= 125 
  
                   coef exp(coef) se(coef)      z Pr(&gt;|z|)    
  log(bili)     1.24121   3.45981  0.09697 12.800   &lt;2e-16 ***
  log(protime)  3.98340  53.69929  0.43589  9.139   &lt;2e-16 ***
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  
               exp(coef) exp(-coef) lower .95 upper .95
  log(bili)         3.46    0.28903     2.861     4.184
  log(protime)     53.70    0.01862    22.853   126.181
  
  **Concordance= 0.886  (se = 0.029 )**
  Rsquare= 0.168   (max possible= 0.508 )
  Likelihood ratio test= 332.1  on 2 df,   p=&lt;2e-16
  Wald test            = 263.3  on 2 df,   p=&lt;2e-16
  Score (logrank) test = 467.8  on 2 df,   p=&lt;2e-16
  </code></pre>
  
  <p>Would it make sense to use the validation function from the RMS package to get a 95% CI for the C-index using bootstrapping? I came up with the following code. What do you think? I´m however not sure how to correctly treat the Dxy values from the training / test colums (the CI from training seems OK to me whereas the CI from the test colums seens very narrow). </p>
  
  <pre><code>library(survival)
  library(rms)
  library(tidyboot)
  
  temp &lt;- subset(pbc, id &lt;= 312, select=c(id:sex, stage))
  pbc2 &lt;- tmerge(temp, temp, id=id, death = event(time, status)) #set range
  pbc2 &lt;- tmerge(pbc2, pbcseq, id=id, ascites = tdc(day, ascites),
  bili = tdc(day, bili), albumin = tdc(day, albumin),
  protime = tdc(day, protime), alk.phos = tdc(day, alk.phos))
  fit2 &lt;- cph(Surv(tstart, tstop, death==2) ~ log(bili) + log(protime), pbc2, x=T, y=T, surv=T)
  set.seed(1)
  output &lt;- capture.output(validate(fit2, method="boot", B=1000, dxy=T, pr =T))
  head(output)
  output &lt;- as.matrix(output)
  output_dxy &lt;- as.matrix(output[grep('^Dxy', output[,1]),])
  output_dxy &lt;- gsub("(?&lt;=[\\s])\\s*|^\\s+|\\s+$", "", output_dxy, perl=TRUE)
  train &lt;- abs(as.numeric(lapply(strsplit(output_dxy, split=" "), "[", 2))[1:1000])/2+0.5
  test &lt;- abs(as.numeric(lapply(strsplit(output_dxy, split=" "), "[", 3))[1:1000])/2+0.5
  summary(train)
  summary(test)
  ci_lower(train, na.rm = FALSE)
  ci_upper(train, na.rm = FALSE)
  ci_lower(test, na.rm = FALSE)
  ci_upper(test, na.rm = FALSE)
  </code></pre>