R/print.ipcwcompetingrisksROC.R

Defines functions print.ipcwcompetingrisksROC

Documented in print.ipcwcompetingrisksROC

print.ipcwcompetingrisksROC <- function(x,No.lines=5,digits=2,...){
  # {{{ generate table to print
  if(x$iid==TRUE){
    tab_ou_print<-round(cbind(x$Stats,x$AUC_1*100,x$inference$vect_sd_1*100,
                              x$AUC_2*100,x$inference$vect_sd_2*100),digits=digits)
    colnames(tab_ou_print)<-c("Cases","Survivors","Other events","Censored","AUC_1 (%)","se_1",
                              "AUC_2 (%)","se_2")
  }
  else{
    tab_ou_print<-round(cbind(x$Stats,x$AUC_1*100,x$AUC_2*100),digits=digits)
    colnames(tab_ou_print)<-c("Cases","Survivors","Other events","Censored","AUC_1 (%)","AUC_2 (%)")  
  }
  # }}}
  cat(paste("Time-dependent-Roc curve estimated using IPCW  (n=",x$n, ", with competing risks). \n",sep=""))
  # {{{ print the table or the quantile rows of the table
  l<-length(x$times)
  if(l<=No.lines){  print(tab_ou_print) }
  else{print(tab_ou_print[unique(round(quantile(1:length(x$times),probs=seq(0,1,length.out=No.lines)),0)),])}
  # }}}
  cat("\n")
  cat("Method used for estimating IPCW:")
  cat(paste(x$weights$method,"\n"))
  cat("\n")
  cat("Total computation time :",round(x$computation_time,2)," secs.")
  cat("\n")
}

Try the timeROC package in your browser

Any scripts or data that you put into this service are public.

timeROC documentation built on Dec. 25, 2019, 9:06 a.m.