concordance.index: Function to compute the concordance index for survival or...

Description Usage Arguments Value Note Author(s) References See Also Examples

Description

Function to compute the concordance index for a risk prediction, i.e. the probability that, for a pair of randomly chosen comparable samples, the sample with the higher risk prediction will experience an event before the other sample or belongs to a higher binary class.

Usage

1
2
3
concordance.index(x, surv.time, surv.event, cl, weights, comppairs=10,
strat, alpha = 0.05, outx = TRUE, method = c("conservative", "noether",
"nam"), alternative = c("two.sided", "less", "greater"), na.rm = FALSE)

Arguments

x

a vector of risk predictions.

surv.time

a vector of event times.

surv.event

a vector of event occurence indicators.

cl

a vector of binary class indicators.

weights

weight of each sample.

comppairs

threshold for compairable patients.

strat

stratification indicator.

alpha

apha level to compute confidence interval.

outx

set to TRUE to not count pairs of observations tied on x as a relevant pair. This results in a Goodman-Kruskal gamma type rank correlation.

method

can take the value conservative, noether or name (see paper Pencina et al. for details).

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" (concordance index is greater than 0.5) or "less" (concordance index is less than 0.5). You can specify just the initial letter.

na.rm

TRUE if missing values should be removed.

Value

c.index

concordance index estimate.

se

standard error of the estimate.

lower

lower bound for the confidence interval.

upper

upper bound for the confidence interval.

p.value

p-value for the statistical test if the estimate if different from 0.5.

n

number of samples used for the estimation.

data

list of data used to compute the index (x, surv.time and surv.event, or cl).

comppairs

number of compairable pairs.

Note

The "direction" of the concordance index (< 0.5 or > 0.5) is the opposite than the rcorr.cens function in the Hmisc package. So you can easily get the same results than rcorr.cens by changing the sign of x.

Author(s)

Benjamin Haibe-Kains, Markus Schroeder

References

Harrel Jr, F. E. and Lee, K. L. and Mark, D. B. (1996) "Tutorial in biostatistics: multivariable prognostic models: issues in developing models, evaluating assumptions and adequacy, and measuring and reducing error", Statistics in Medicine, 15, pages 361–387.

Pencina, M. J. and D'Agostino, R. B. (2004) "Overall C as a measure of discrimination in survival analysis: model specific population value and confidence interval estimation", Statistics in Medicine, 23, pages 2109–2123, 2004.

See Also

rcorr.cens, phcpe, coxphCPE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
set.seed(12345)
age <- rnorm(100, 50, 10)
sex <- sample(0:1, 100, replace=TRUE)
stime <- rexp(100)
cens   <- runif(100,.5,2)
sevent  <- as.numeric(stime <= cens)
stime <- pmin(stime, cens)
strat <- sample(1:3, 100, replace=TRUE)
weight <- runif(100, min=0, max=1)
comppairs <- 10
cat("survival prediction:\n")
concordance.index(x=age, surv.time=stime, surv.event=sevent, strat=strat,
  weights=weight, method="noether", comppairs=comppairs)
cat("binary class prediction:\n")
## is age predictive of sex?
concordance.index(x=age, cl=sex, strat=strat, method="noether")

Example output

Loading required package: survival
Loading required package: prodlim
survival prediction:
$c.index
[1] 0.5230613

$se
[1] 0.03343403

$lower
[1] 0.4575318

$upper
[1] 0.5885908

$p.value
[1] 0.4903484

$n
[1] 100

$data
$data$x
  [1] 55.85529 57.09466 48.90697 45.46503 56.05887 31.82044 56.30099 47.23816
  [9] 47.15840 40.80678 48.83752 68.17312 53.70628 55.20216 42.49468 58.16900
 [17] 41.13642 46.68422 61.20713 52.98724 57.79622 64.55785 43.55672 34.46863
 [25] 34.02290 68.05098 45.18353 56.20380 56.12123 48.37689 58.11873 71.96834
 [33] 70.49190 66.32446 52.54271 54.91188 46.75913 33.37950 67.67734 50.25801
 [41] 61.28511 26.19642 39.39734 59.37141 58.54452 64.60729 35.86901 55.67403
 [49] 55.83188 36.93201 44.59614 69.47693 50.53590 53.51663 43.29023 52.77954
 [57] 56.91171 58.23795 71.45065 26.53056 51.49592 36.57469 55.53303 65.89963
 [65] 44.13120 31.67623 58.88139 65.93488 55.16855 37.04328 50.54616 42.15351
 [73] 39.50647 73.30512 64.02705 59.42601 58.26258 41.88460 54.76248 60.21258
 [81] 56.45383 60.43144 46.95631 74.77111 59.71221 68.67099 56.72042 46.92047
 [89] 55.36524 58.24870 40.36099 41.44917 68.86947 46.08181 40.19367 56.87332
 [97] 44.94956 71.57720 44.00202 43.05453

$data$surv.time
  [1] 0.637853355 0.197314564 0.416581293 0.306881320 0.154827937 0.356571066
  [7] 1.096221586 1.406930427 1.064566905 0.847219292 0.938433472 0.365299973
 [13] 0.723795729 0.216887802 0.238225399 0.890783290 0.969024341 0.011000799
 [19] 1.663490611 1.397090765 0.473277677 0.349694525 0.896520485 0.459397995
 [25] 1.094637862 0.356546675 0.253164558 0.590390556 0.030716643 0.369448074
 [31] 0.244754504 0.440600901 0.170370805 0.150545259 1.384699555 0.574045110
 [37] 0.996481281 1.559945725 0.861266141 0.434629776 0.176064291 0.142967952
 [43] 0.060913060 0.569092280 0.430919448 0.992690456 0.924182842 0.613625630
 [49] 0.920003573 0.356111097 0.568598574 0.130677740 0.022247792 0.116445919
 [55] 1.007857130 0.984365617 1.003222533 0.821054509 0.010615575 0.684983060
 [61] 1.678080778 0.853088171 0.192398773 1.657698993 0.164590429 1.164628168
 [67] 0.083792265 0.433889239 1.360584810 1.896422504 0.481232862 0.540298133
 [73] 0.077356379 1.245692946 0.778048342 0.762629318 1.734777190 0.678462227
 [79] 1.249678811 0.687199211 0.187438627 0.247703603 0.980026351 0.862026664
 [85] 0.134605087 1.576969599 0.075869365 0.525945421 0.618154488 1.404378374
 [91] 0.366814601 0.966280999 1.165185511 0.519370650 1.293312739 1.066429030
 [97] 0.645233040 0.009719983 0.392513916 0.177425891

$data$surv.event
  [1] 0 1 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0
 [38] 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 1 0 0 1 1 1 1 0 1 1 0 0 1 1 1 1
 [75] 1 1 0 0 1 1 1 1 0 0 1 0 1 0 1 0 1 1 0 1 1 0 1 1 1 1


$comppairs
[1] 808.7589

binary class prediction:
$c.index
[1] 0.4337789

$se
[1] 0.0548467

$lower
[1] 0.3262813

$upper
[1] 0.5412764

$p.value
[1] 0.2272835

$n
[1] 100

$data
$data$x
  [1] 55.85529 57.09466 48.90697 45.46503 56.05887 31.82044 56.30099 47.23816
  [9] 47.15840 40.80678 48.83752 68.17312 53.70628 55.20216 42.49468 58.16900
 [17] 41.13642 46.68422 61.20713 52.98724 57.79622 64.55785 43.55672 34.46863
 [25] 34.02290 68.05098 45.18353 56.20380 56.12123 48.37689 58.11873 71.96834
 [33] 70.49190 66.32446 52.54271 54.91188 46.75913 33.37950 67.67734 50.25801
 [41] 61.28511 26.19642 39.39734 59.37141 58.54452 64.60729 35.86901 55.67403
 [49] 55.83188 36.93201 44.59614 69.47693 50.53590 53.51663 43.29023 52.77954
 [57] 56.91171 58.23795 71.45065 26.53056 51.49592 36.57469 55.53303 65.89963
 [65] 44.13120 31.67623 58.88139 65.93488 55.16855 37.04328 50.54616 42.15351
 [73] 39.50647 73.30512 64.02705 59.42601 58.26258 41.88460 54.76248 60.21258
 [81] 56.45383 60.43144 46.95631 74.77111 59.71221 68.67099 56.72042 46.92047
 [89] 55.36524 58.24870 40.36099 41.44917 68.86947 46.08181 40.19367 56.87332
 [97] 44.94956 71.57720 44.00202 43.05453

$data$cl
  [1] 1 1 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 1 1 0 0 0 0 1 1 1 1 0 0 1 0 1 0 1 1 1 1
 [38] 1 0 0 1 1 1 1 1 1 1 1 0 1 0 1 0 0 1 1 0 0 0 0 1 1 1 1 1 0 0 1 1 1 0 0 0 1
 [75] 1 0 1 0 0 1 0 1 0 0 0 0 0 1 1 1 1 1 0 0 1 0 1 0 1 0


$comppairs
[1] 1646

survcomp documentation built on Nov. 8, 2020, 4:54 p.m.