concordance.index {survcomp} | R Documentation |
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.
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)
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 |
method |
can take the value |
alternative |
a character string specifying the alternative hypothesis, must be one of |
na.rm |
|
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 ( |
comppairs |
number of compairable pairs. |
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
.
Benjamin Haibe-Kains, Markus Schroeder
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.
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")