NIK and RRPlots

The libraries

library(survival)
library(FRESA.CAD)
## Loading required package: Rcpp
## Loading required package: stringr
## Loading required package: miscTools
## Loading required package: Hmisc
## 
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:base':
## 
##     format.pval, units
## Loading required package: pROC
## Type 'citation("pROC")' for a citation.
## 
## Attaching package: 'pROC'
## The following objects are masked from 'package:stats':
## 
##     cov, smooth, var
library(Biobase)
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## The following object is masked from 'package:pROC':
## 
##     var
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, append, as.data.frame, basename, cbind, colnames,
##     dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
##     grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
##     order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
##     rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
##     union, unique, unsplit, which.max, which.min
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## 
## Attaching package: 'Biobase'
## The following object is masked from 'package:Hmisc':
## 
##     contents
## The following object is masked from 'package:miscTools':
## 
##     rowMedians
op <- par(no.readonly = TRUE)
pander::panderOptions('digits', 3)
pander::panderOptions('table.split.table', 400)
pander::panderOptions('keep.trailing.zeros',TRUE)
if (!require("BiocManager", quietly = TRUE))
{
    install.packages("BiocManager")
    BiocManager::install("seventyGeneData")
}
## Bioconductor version '3.15' is out-of-date; the current release version '3.17'
##   is available with R version '4.3'; see https://bioconductor.org/install
library(seventyGeneData)
data(vanDeVijver)
class(vanDeVijver)
## [1] "ExpressionSet"
## attr(,"package")
## [1] "Biobase"

Getting the clinical data

pdata <- pData(vanDeVijver)

ROC Plots

table(pdata$Posnodes)

n y 151 144

pander::pander(table(pdata$TTMevent))
0 1
194 101
pmroc <- plotModels.ROC(cbind(pdata$TTMevent,-pdata$C1used),name="NIK",thr= -0.4) ## Using paper threshold

par(op)

RR Plot Signature correlation

rdata <- cbind(pdata$TTMevent,pdata$C1used)


RRAnalysisCI <- RRPlot(rdata,atRate=c(0.10,0.05),
                     timetoEvent=pdata$RFS,
                     title="Signature: Breast Cancer",
                     ysurvlim=c(0.00,1.0))

par(op)

CI Performance all data

pander::pander(t(RRAnalysisCI$keyPoints),caption="Threshold values")
Threshold values
  @:0.1 @:0.05 @MAX_BACC @MAX_RR @SPE100
Thr 0.519 0.619 0.465 0.623 7.56e-01
RR 3.806 3.548 4.160 5.069 3.91e+01
RR_LCI 2.082 1.642 2.391 1.954 8.17e-02
RR_UCI 6.957 7.666 7.237 13.150 1.87e+04
SEN 0.901 0.941 0.881 0.960 1.00e+00
SPE 0.397 0.247 0.485 0.242 5.67e-02
BACC 0.649 0.594 0.683 0.601 5.28e-01
pander::pander(RRAnalysisCI$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.698 0.698 0.647 0.745
pander::pander(t(RRAnalysisCI$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.692 0.631 0.752
pander::pander((RRAnalysisCI$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.891 0.813 0.944
pander::pander((RRAnalysisCI$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.397 0.328 0.469
pander::pander(t(RRAnalysisCI$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.517 0.618
pander::pander(RRAnalysisCI$surdif,caption="Logrank test")
Logrank test Chisq = 28.085735 on 2 degrees of freedom, p = 0.000001
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 55 6 23.5 13.01 17.1
class=1 33 5 12.9 4.87 5.6
class=2 207 90 64.6 10.00 27.9

Node positive data

RR Plot Signature correlation

NodePdata <- subset(pdata,Posnodes=="y")

rdata <- cbind(NodePdata$TTMevent,NodePdata$C1used)


RRAnalysisPos <- RRPlot(rdata,atRate=c(0.90,0.95),
                     timetoEvent=NodePdata$RFS,
                     title="Signature: Breast Cancer",
                     ysurvlim=c(0.00,1.0))

par(op)

CI Performance positive data

pander::pander(t(RRAnalysisPos$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100
Thr 0.486 0.655 0.267 0.486 7.17e-01
RR 3.231 1.579 3.083 3.231 1.34e+01
RR_LCI 1.377 0.563 1.746 1.377 2.94e-02
RR_UCI 7.578 4.431 5.444 7.578 6.14e+03
SEN 0.894 0.936 0.745 0.894 1.00e+00
SPE 0.361 0.113 0.639 0.361 4.12e-02
BACC 0.627 0.525 0.692 0.627 5.21e-01
pander::pander(RRAnalysisPos$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.7 0.699 0.622 0.768
pander::pander(t(RRAnalysisPos$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.669 0.576 0.761
pander::pander((RRAnalysisPos$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.894 0.769 0.965
pander::pander((RRAnalysisPos$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.371 0.275 0.475
pander::pander(t(RRAnalysisPos$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.484 0.651
pander::pander(RRAnalysisPos$surdif,caption="Logrank test")
Logrank test Chisq = 11.060876 on 2 degrees of freedom, p = 0.003964
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 15 3 5.80 1.35 1.55
class=1 26 2 9.73 6.14 7.77
class=2 103 42 31.47 3.52 10.71

Node Negative data

RR Plot Signature correlation

NodeNdata <- subset(pdata,Posnodes=="n")

rdata <- cbind(NodeNdata$TTMevent,NodeNdata$C1used)


RRAnalysisNeg <- RRPlot(rdata,atRate=c(0.90,0.95),
                     timetoEvent=NodeNdata$RFS,
                     title="Signature: Breast Cancer",
                     ysurvlim=c(0.00,1.0))

par(op)

CI Performance negative data

pander::pander(t(RRAnalysisNeg$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100
Thr 0.507 0.585 0.465 0.623 7.56e-01
RR 4.454 5.920 5.130 15.402 3.42e+01
RR_LCI 2.040 1.959 2.344 2.211 7.18e-02
RR_UCI 9.723 17.889 11.228 107.305 1.63e+04
SEN 0.889 0.944 0.889 0.981 1.00e+00
SPE 0.495 0.371 0.546 0.340 9.28e-02
BACC 0.692 0.658 0.718 0.661 5.46e-01
pander::pander(RRAnalysisNeg$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.695 0.697 0.631 0.769
pander::pander(t(RRAnalysisNeg$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.709 0.627 0.791
pander::pander((RRAnalysisNeg$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.889 0.774 0.958
pander::pander((RRAnalysisNeg$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.495 0.392 0.598
pander::pander(t(RRAnalysisNeg$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.513 0.583
pander::pander(RRAnalysisNeg$surdif,caption="Logrank test")
Logrank test Chisq = 24.223875 on 2 degrees of freedom, p = 0.000005
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 40 3 18.18 12.67 19.29
class=1 14 3 5.43 1.09 1.21
class=2 97 48 30.39 10.21 23.58

RRPlot Cox Model

timeinterval <- 5 # Five years

h0 <- sum(pdata$TTMevent & pdata$RFS <= timeinterval)
h0 <- h0/sum((pdata$RFS > timeinterval) | (pdata$TTMevent==1))

mcox <- coxph(Surv(RFS,TTMevent)~C1used,pdata)
pander::pander(summary(mcox)$coefficients)
  coef exp(coef) se(coef) z Pr(>|z|)
C1used -1.5 0.224 0.263 -5.69 1.3e-08
index <- predict(mcox,pdata)
rdata <- cbind(pdata$TTMevent,ppoisGzero(index,h0))


RRAnalysisCox <- RRPlot(rdata,atRate=c(0.90,0.95),
                     timetoEvent=pdata$RFS,
                     title="NIK: Breast Cancer",
                     ysurvlim=c(0.00,1.0),
                     riskTimeInterval=timeinterval)

par(op)

Expected time to event

toinclude <- rdata[,1]==1 | pdata$RFS > 2.0*timeinterval
obstiemToEvent <- pdata[toinclude,"RFS"]
tmin<-min(obstiemToEvent)
sum(toinclude)

[1] 167

timetoEvent <- meanTimeToEvent(rdata[toinclude,2],timeinterval)
tmax<-max(c(obstiemToEvent,timetoEvent))
lmfit <- lm(obstiemToEvent~0+timetoEvent)
sm <- summary(lmfit)
pander::pander(sm)
  Estimate Std. Error t value Pr(>|t|)
timetoEvent 0.736 0.0364 20.2 1.24e-46
Fitting linear model: obstiemToEvent ~ 0 + timetoEvent
Observations Residual Std. Error \(R^2\) Adjusted \(R^2\)
167 4.86 0.711 0.709
plot(timetoEvent,obstiemToEvent,
     col=1+rdata[toinclude,1],
     xlab="Expected time",
     ylab="Observed time",
     main="Expected vs. Observed",
     xlim=c(tmin,tmax),
     ylim=c(tmin,tmax),
     log="xy")
lines(x=c(tmin,tmax),y=lmfit$coefficients*c(tmin,tmax),lty=1,col="blue")
text(tmin+0.01*(tmax-tmin),tmax,sprintf("R.sq=%3.2f",sm$r.squared),cex=0.7)

MADerror2 <- mean(abs(timetoEvent-obstiemToEvent))
pander::pander(MADerror2)

4.67

Unadjusted Cox Performance

pander::pander(t(RRAnalysisCox$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Thr 0.176 0.154 0.190 0.153 1.27e-01 0.5041
RR 3.806 3.548 4.160 5.069 3.91e+01 0.9241
RR_LCI 2.082 1.642 2.391 1.954 8.17e-02 0.4906
RR_UCI 6.957 7.666 7.237 13.150 1.87e+04 1.7407
SEN 0.901 0.941 0.881 0.960 1.00e+00 0.0693
SPE 0.397 0.247 0.485 0.242 5.67e-02 0.9227
BACC 0.649 0.594 0.683 0.601 5.28e-01 0.4960
NetBenefit 0.223 0.232 0.222 0.239 2.52e-01 -0.0279
pander::pander(t(RRAnalysisCox$OERatio$estimate),caption="O/E Ratio")
O/E Ratio
O/E Low Upper p.value
0.871 0.709 1.06 0.178
pander::pander(t(RRAnalysisCox$OE95ci),caption="O/E Mean")
O/E Mean
mean 50% 2.5% 97.5%
0.958 0.959 0.931 0.985
pander::pander(t(RRAnalysisCox$OAcum95ci),caption="O/Acum Mean")
O/Acum Mean
mean 50% 2.5% 97.5%
1.22 1.22 1.2 1.24
pander::pander(RRAnalysisCox$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.698 0.698 0.649 0.745
pander::pander(t(RRAnalysisCox$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.692 0.631 0.752
pander::pander((RRAnalysisCox$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.891 0.813 0.944
pander::pander((RRAnalysisCox$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.397 0.328 0.469
pander::pander(t(RRAnalysisCox$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.177 0.154
pander::pander(RRAnalysisCox$surdif,caption="Logrank test")
Logrank test Chisq = 28.085735 on 2 degrees of freedom, p = 0.000001
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 55 6 23.5 13.01 17.1
class=1 33 5 12.9 4.87 5.6
class=2 207 90 64.6 10.00 27.9

RRPlot Cox Adjusted Model

This time we will include Lymph node status from pathology report and Estrogen receptor alpha expression measurement from microarray

mcox <- coxph(Surv(RFS,TTMevent)~C1used*(ESR1 + Posnodes),pdata)
pander::pander(summary(mcox)$coefficients)
  coef exp(coef) se(coef) z Pr(>|z|)
C1used -0.403 0.668 0.629 -0.640 0.52186
ESR1 0.123 1.131 0.255 0.481 0.63079
Posnodesy -0.305 0.737 0.217 -1.401 0.16112
C1used:ESR1 -1.913 0.148 0.739 -2.588 0.00966
C1used:Posnodesy 0.378 1.460 0.583 0.649 0.51661
index <- predict(mcox,pdata)
rdata <- cbind(pdata$TTMevent,ppoisGzero(index,h0))


RRAnalysisAdCox <- RRPlot(rdata,atRate=c(0.90,0.95),
                     timetoEvent=pdata$RFS,
                     title="Adjusted: Breast Cancer",
                     ysurvlim=c(0.00,1.0),
                     riskTimeInterval=timeinterval)

par(op)

Expected time to event

timetoEvent <- meanTimeToEvent(rdata[toinclude,2],timeinterval)
tmax<-max(c(obstiemToEvent,timetoEvent))
lmfit <- lm(obstiemToEvent~0+timetoEvent)
sm <- summary(lmfit)
pander::pander(sm)
  Estimate Std. Error t value Pr(>|t|)
timetoEvent 0.639 0.0339 18.9 3.63e-43
Fitting linear model: obstiemToEvent ~ 0 + timetoEvent
Observations Residual Std. Error \(R^2\) Adjusted \(R^2\)
167 5.09 0.682 0.68
plot(timetoEvent,obstiemToEvent,
     col=1+rdata[toinclude,1],
     xlab="Expected time",
     ylab="Observed time",
     main="Expected vs. Observed",
     xlim=c(tmin,tmax),
     ylim=c(tmin,tmax),
     log="xy")
lines(x=c(tmin,tmax),y=lmfit$coefficients*c(tmin,tmax),lty=1,col="blue")
text(tmin+0.01*(tmax-tmin),tmax,sprintf("R.sq=%3.2f",sm$r.squared),cex=0.7)

MADerror2 <-c(MADerror2,mean(abs(timetoEvent-obstiemToEvent)))
pander::pander(MADerror2)

4.67 and 5.51

Adjusted Cox Performance

pander::pander(t(RRAnalysisAdCox$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Thr 0.159 0.133 0.205 0.133 9.92e-02 0.50740
RR 3.422 4.043 3.235 4.699 3.54e+01 1.72657
RR_LCI 1.928 1.863 2.100 2.004 7.42e-02 1.06501
RR_UCI 6.075 8.773 4.984 11.015 1.69e+04 2.79908
SEN 0.891 0.941 0.802 0.950 1.00e+00 0.07921
SPE 0.392 0.278 0.572 0.273 5.15e-02 0.96907
BACC 0.641 0.609 0.687 0.612 5.26e-01 0.52414
NetBenefit 0.230 0.249 0.202 0.252 2.74e-01 0.00617
pander::pander(t(RRAnalysisAdCox$OERatio$estimate),caption="O/E Ratio")
O/E Ratio
O/E Low Upper p.value
0.904 0.737 1.1 0.344
pander::pander(t(RRAnalysisAdCox$OE95ci),caption="O/E Mean")
O/E Mean
mean 50% 2.5% 97.5%
0.98 0.98 0.954 1.01
pander::pander(t(RRAnalysisAdCox$OAcum95ci),caption="O/Acum Mean")
O/Acum Mean
mean 50% 2.5% 97.5%
1.24 1.24 1.22 1.25
pander::pander(RRAnalysisAdCox$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.707 0.707 0.659 0.751
pander::pander(t(RRAnalysisAdCox$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.702 0.642 0.763
pander::pander((RRAnalysisAdCox$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.891 0.813 0.944
pander::pander((RRAnalysisAdCox$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.397 0.328 0.469
pander::pander(t(RRAnalysisAdCox$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.159 0.133
pander::pander(RRAnalysisAdCox$surdif,caption="Logrank test")
Logrank test Chisq = 28.504862 on 2 degrees of freedom, p = 0.000001
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 60 6 25.3 14.73 19.76
class=1 28 5 11.2 3.45 3.89
class=2 207 90 64.5 10.11 28.16

Calibrating the index

calprob <- CoxRiskCalibration(mcox,pdata,"TTMevent","RFS")
pander::pander(c(h0=calprob$h0,
                 Gain=calprob$hazardGain,
                 DeltaTime=calprob$timeInterval),
               caption="Cox Calibration Parameters")
h0 Gain DeltaTime
0.401 0.987 7.16
h0 <- calprob$h0
timeinterval <- calprob$timeInterval;

rdata <- cbind(pdata$TTMevent,calprob$prob)


RRAnalysisCalAdCox <- RRPlot(rdata,atRate=c(0.90,0.95),
                     timetoEvent=pdata$RFS,
                     title="Cal. NIK: Breast Cancer",
                     ysurvlim=c(0.00,1.0),
                     riskTimeInterval=timeinterval)

par(op)

Expected time to event

timetoEvent <- meanTimeToEvent(rdata[toinclude,2],timeinterval)
tmax<-max(c(obstiemToEvent,timetoEvent))
lmfit <- lm(obstiemToEvent~0+timetoEvent)
sm <- summary(lmfit)
pander::pander(sm)
  Estimate Std. Error t value Pr(>|t|)
timetoEvent 0.623 0.033 18.9 3.63e-43
Fitting linear model: obstiemToEvent ~ 0 + timetoEvent
Observations Residual Std. Error \(R^2\) Adjusted \(R^2\)
167 5.09 0.682 0.68
plot(timetoEvent,obstiemToEvent,
     col=1+rdata[toinclude,1],
     xlab="Expected time",
     ylab="Observed time",
     main="Expected vs. Observed",
     xlim=c(tmin,tmax),
     ylim=c(tmin,tmax),
     log="xy")
lines(x=c(tmin,tmax),y=lmfit$coefficients*c(tmin,tmax),lty=1,col="blue")
text(tmin+0.01*(tmax-tmin),tmax,sprintf("R.sq=%3.2f",sm$r.squared),cex=0.7)

MADerror2 <-c(MADerror2,mean(abs(timetoEvent-obstiemToEvent)))
pander::pander(MADerror2)

4.67, 5.51 and 5.69

Calibrated and Adjusted Cox Performance

pander::pander(t(RRAnalysisCalAdCox$keyPoints),caption="Threshold values")
Threshold values
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Thr 0.215 0.181 0.274 0.180 1.36e-01 0.5003
RR 3.422 4.043 3.235 4.699 3.54e+01 1.8316
RR_LCI 1.928 1.863 2.100 2.004 7.42e-02 1.3487
RR_UCI 6.075 8.773 4.984 11.015 1.69e+04 2.4875
SEN 0.891 0.941 0.802 0.950 1.00e+00 0.3366
SPE 0.392 0.278 0.572 0.273 5.15e-02 0.8454
BACC 0.641 0.609 0.687 0.612 5.26e-01 0.5910
NetBenefit 0.196 0.217 0.168 0.220 2.44e-01 0.0135
pander::pander(t(RRAnalysisCalAdCox$OERatio$estimate),caption="O/E Ratio")
O/E Ratio
O/E Low Upper p.value
0.923 0.752 1.12 0.445
pander::pander(t(RRAnalysisCalAdCox$OE95ci),caption="O/E Mean")
O/E Mean
mean 50% 2.5% 97.5%
1.01 1 0.98 1.03
pander::pander(t(RRAnalysisCalAdCox$OAcum95ci),caption="O/Acum Mean")
O/Acum Mean
mean 50% 2.5% 97.5%
0.973 0.973 0.964 0.983
pander::pander(RRAnalysisCalAdCox$c.index$cstatCI,caption="C. Index")
mean.C Index median lower upper
0.707 0.706 0.66 0.751
pander::pander(t(RRAnalysisCalAdCox$ROCAnalysis$aucs),caption="ROC AUC")
ROC AUC
est lower upper
0.702 0.642 0.763
pander::pander((RRAnalysisCalAdCox$ROCAnalysis$sensitivity),caption="Sensitivity")
Sensitivity
est lower upper
0.891 0.813 0.944
pander::pander((RRAnalysisCalAdCox$ROCAnalysis$specificity),caption="Specificity")
Specificity
est lower upper
0.397 0.328 0.469
pander::pander(t(RRAnalysisCalAdCox$thr_atP),caption="Probability Thresholds")
Probability Thresholds
10% 5%
0.215 0.181
pander::pander(RRAnalysisCalAdCox$surdif,caption="Logrank test")
Logrank test Chisq = 28.504862 on 2 degrees of freedom, p = 0.000001
  N Observed Expected (O-E)^2/E (O-E)^2/V
class=0 60 6 25.3 14.73 19.76
class=1 28 5 11.2 3.45 3.89
class=2 207 90 64.5 10.11 28.16

Comparing Risks

Comparing concordance Index

## Correlation Index
cindex <- RRAnalysisCI$c.index$cstatCI
## Cox Index
cindex <- rbind(cindex,RRAnalysisCox$c.index$cstatCI)
## Adjusted Cox Index
cindex <- rbind(cindex,RRAnalysisAdCox$c.index$cstatCI)
## Adjusted and Calibrated Cox Index
cindex <- rbind(cindex,RRAnalysisCalAdCox$c.index$cstatCI)
rownames(cindex) <- c("CI","Cox","Adj. Cox","Cal. Adj. Cox")

pander::pander(cindex)
  mean.C Index median lower upper
CI 0.698 0.698 0.647 0.745
Cox 0.698 0.698 0.649 0.745
Adj. Cox 0.707 0.707 0.659 0.751
Cal. Adj. Cox 0.707 0.706 0.660 0.751

Comparing Risk Ratios Index

## Correlation Index
RRratio <- c(RR=RRAnalysisCI$keyPoints$RR[1],
             LCI=RRAnalysisCI$keyPoints$RR_LCI[1],
             UCI=RRAnalysisCI$keyPoints$RR_UCI[1])
## Cox Index
RRratio <- rbind(RRratio,c(RR=RRAnalysisCox$keyPoints$RR[1],
                           LCI=RRAnalysisCox$keyPoints$RR_LCI[1],
                           UCI=RRAnalysisCox$keyPoints$RR_UCI[1]))
## Adjusted Cox Index
RRratio <- rbind(RRratio,c(RR=RRAnalysisAdCox$keyPoints$RR[1],
                           LCI=RRAnalysisAdCox$keyPoints$RR_LCI[1],
                           UCI=RRAnalysisAdCox$keyPoints$RR_UCI[1]))
## Adjusted and Calibrated Cox Index
RRratio <- rbind(RRratio,c(RR=RRAnalysisCalAdCox$keyPoints$RR[1],
                           LCI=RRAnalysisCalAdCox$keyPoints$RR_LCI[1],
                           UCI=RRAnalysisCalAdCox$keyPoints$RR_UCI[1]))
rownames(RRratio) <- c("CI","Cox","Adj. Cox","Cal. Adj. Cox")
pander::pander(RRratio)
  RR LCI UCI
CI 3.81 2.08 6.96
Cox 3.81 2.08 6.96
Adj. Cox 3.42 1.93 6.07
Cal. Adj. Cox 3.42 1.93 6.07

Comparing logRank values

## Correlation Index
SurvDif <- c(chisq=RRAnalysisCI$surdif$chisq,pvalue=RRAnalysisCI$surdif$pvalue)
## Cox Index
SurvDif <- rbind(SurvDif,c(chisq=RRAnalysisCox$surdif$chisq,pvalue=RRAnalysisCox$surdif$pvalue))
## Adjusted Cox Index
SurvDif <- rbind(SurvDif,c(chisq=RRAnalysisAdCox$surdif$chisq,pvalue=RRAnalysisAdCox$surdif$pvalue))
## Adjusted and Calibrated Cox Index
SurvDif <- rbind(SurvDif,c(chisq=RRAnalysisCalAdCox$surdif$chisq,pvalue=RRAnalysisCalAdCox$surdif$pvalue))
rownames(SurvDif) <- c("CI","Cox","Adj. Cox","Cal. Adj. Cox")

pander::pander(SurvDif)
  chisq pvalue
CI 28.1 7.97e-07
Cox 28.1 7.97e-07
Adj. Cox 28.5 6.46e-07
Cal. Adj. Cox 28.5 6.46e-07

Comparing Sensitivity

## Correlation Index
sensi <- RRAnalysisCI$ROCAnalysis$sensitivity
## Cox Index
sensi <- rbind(sensi,RRAnalysisCox$ROCAnalysis$sensitivity)
## Adjusted Cox Index
sensi <- rbind(sensi,RRAnalysisAdCox$ROCAnalysis$sensitivity)
## Adjusted and Calibrated Cox Index
sensi <- rbind(sensi,RRAnalysisCalAdCox$ROCAnalysis$sensitivity)
rownames(sensi) <- c("CI","Cox","Adj. Cox","Cal. Adj. Cox")

pander::pander(sensi)
  est lower upper
CI 0.891 0.813 0.944
Cox 0.891 0.813 0.944
Adj. Cox 0.891 0.813 0.944
Cal. Adj. Cox 0.891 0.813 0.944

Comparing Specificity

## Correlation Index
speci <- RRAnalysisCI$ROCAnalysis$specificity
## Cox Index
speci <- rbind(speci,RRAnalysisCox$ROCAnalysis$specificity)
## Adjusted Cox Index
speci <- rbind(speci,RRAnalysisAdCox$ROCAnalysis$specificity)
## Adjusted and Calibrated Cox Index
speci <- rbind(speci,RRAnalysisCalAdCox$ROCAnalysis$specificity)
rownames(speci) <- c("CI","Cox","Adj. Cox","Cal. Adj. Cox")
pander::pander(speci)
  est lower upper
CI 0.397 0.328 0.469
Cox 0.397 0.328 0.469
Adj. Cox 0.397 0.328 0.469
Cal. Adj. Cox 0.397 0.328 0.469

Comparing O/E

OERatio <- NULL
## Cox Index
OERatio <- rbind(OERatio,RRAnalysisCox$OERatio$estimate)
## Adjusted Cox Index
OERatio <- rbind(OERatio,RRAnalysisAdCox$OERatio$estimate)
## Adjusted and Calibrated Cox Index
OERatio <- rbind(OERatio,RRAnalysisCalAdCox$OERatio$estimate)
rownames(OERatio) <- c("Cox","Adj. Cox","Cal. Adj. Cox")

pander::pander(OERatio)
  O/E Low Upper p.value
Cox 0.871 0.709 1.06 0.178
Adj. Cox 0.904 0.737 1.10 0.344
Cal. Adj. Cox 0.923 0.752 1.12 0.445

Comparing O/Acum

OARatio <- NULL
## Cox Index
OARatio <- rbind(OARatio,RRAnalysisCox$OARatio$estimate)
## Adjusted Cox Index
OARatio <- rbind(OARatio,RRAnalysisAdCox$OARatio$estimate)
## Adjusted and Calibrated Cox Index
OARatio <- rbind(OARatio,RRAnalysisCalAdCox$OARatio$estimate)
rownames(OARatio) <- c("Cox","Adj. Cox","Cal. Adj. Cox")
pander::pander(OARatio)
  O/A Low Upper p.value
Cox 1.263 1.029 1.53 0.0217
Adj. Cox 1.290 1.051 1.57 0.0128
Cal. Adj. Cox 0.997 0.812 1.21 1.0000

Comparing NetBenefit

NetBen <- NULL
## Cox Index
NetBen <- rbind(NetBen,RRAnalysisCox$keyPoints$NetBenefit)
## Adjusted Cox Index
NetBen <- rbind(NetBen,RRAnalysisAdCox$keyPoints$NetBenefit)
## Adjusted and Calibrated Cox Index
NetBen <- rbind(NetBen,RRAnalysisCalAdCox$keyPoints$NetBenefit)
colnames(NetBen) <- rownames(RRAnalysisCox$keyPoints)
rownames(NetBen) <- c("Cox","Adj. Cox","Cal. Adj. Cox")
pander::pander(NetBen)
  @:0.9 @:0.95 @MAX_BACC @MAX_RR @SPE100 p(0.5)
Cox 0.223 0.232 0.222 0.239 0.252 -0.02795
Adj. Cox 0.230 0.249 0.202 0.252 0.274 0.00617
Cal. Adj. Cox 0.196 0.217 0.168 0.220 0.244 0.01345

Compare the ROC AUC

pander::pander(pROC::roc.test(RRAnalysisCI$ROCAnalysis$ROC.analysis$roc.predictor,
                              RRAnalysisAdCox$ROCAnalysis$ROC.analysis$roc.predictor))
DeLong’s test for two correlated ROC curves: RRAnalysisCI$ROCAnalysis$ROC.analysis$roc.predictor and RRAnalysisAdCox$ROCAnalysis$ROC.analysis$roc.predictor
Test statistic P value Alternative hypothesis AUC of roc1 AUC of roc2
-0.988 0.323 two.sided 0.692 0.702