Description Usage Arguments Details Value Author(s) References See Also Examples
Function to compute the D index for a risk prediction, i.e. an estimate of the log hazard ratio comparing two equal-sized prognostic groups. This is a natural measure of separation between two independent survival distributions under the proportional hazards assumption.
1 2 |
x |
a vector of risk predictions. |
surv.time |
a vector of event times. |
surv.event |
a vector of event occurrence indicators. |
weights |
weight of each sample. |
strat |
stratification indicator. |
alpha |
apha level to compute confidence interval. |
method.test |
Statistical test to use in order to compute the p-values related to a D. index, see summary.coxph for more details. |
na.rm |
|
... |
additional parameters to be passed to the |
The D index is computed using the Cox model fitted on the scaled rankits of the risk scores instead of the risk scores themselves. The scaled rankits are the expected standard Normal order statistics scaled by kappa = sqrt(8/pi)
. See (Royston and Sauerbrei, 2004) for details.
Note that the value D reported in (Royston and Sauerbrei, 2004) is given
d.index |
D index (exponentiated, aka hazard ratio). |
coef |
D index estimate (coefficient) fitted in the cox regression model. |
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. |
coxm |
|
data |
list of data used to compute the index ( |
Benjamin Haibe-Kains
Royston, P. and Sauerbrei, W. (2004) "A new measure of prognostic separation in survival data", Statistics in Medicine, 23, pages 723–748.
coxph
, coxph.object
, normOrder
1 2 3 4 5 6 7 8 9 | set.seed(12345)
age <- rnorm(100, 50, 10)
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)
D.index(x=age, surv.time=stime, surv.event=sevent, weights=weight, strat=strat)
|
Loading required package: survival
Loading required package: prodlim
$d.index
[1] 0.947883
$coef
[1] -0.05352423
$se
[1] 0.2515579
$lower
[1] 0.5789329
$upper
[1] 1.551962
$p.value
[1] 0.8314939
$n
[1] 100
$coxm
Call:
coxph(formula = Surv(stime, sevent) ~ strata(sstrat) + z, weights = sweights)
coef exp(coef) se(coef) z p
z -0.0535 0.9479 0.2516 -0.21 0.83
Likelihood ratio test=0.05 on 1 df, p=0.832
n= 100, number of events= 70
$data
$data$x
[1] 55.9 57.1 48.9 45.5 56.1 31.8 56.3 47.2 47.2 40.8 48.8 68.2 53.7 55.2 42.5
[16] 58.2 41.1 46.7 61.2 53.0 57.8 64.6 43.6 34.5 34.0 68.1 45.2 56.2 56.1 48.4
[31] 58.1 72.0 70.5 66.3 52.5 54.9 46.8 33.4 67.7 50.3 61.3 26.2 39.4 59.4 58.5
[46] 64.6 35.9 55.7 55.8 36.9 44.6 69.5 50.5 53.5 43.3 52.8 56.9 58.2 71.5 26.5
[61] 51.5 36.6 55.5 65.9 44.1 31.7 58.9 65.9 55.2 37.0 50.5 42.2 39.5 73.3 64.0
[76] 59.4 58.3 41.9 54.8 60.2 56.5 60.4 47.0 74.8 59.7 68.7 56.7 46.9 55.4 58.2
[91] 40.4 41.4 68.9 46.1 40.2 56.9 44.9 71.6 44.0 43.1
$data$z
[1] 0.11826 0.26644 -0.16652 -0.33688 0.13425 -1.12907 0.18281 -0.21579
[9] -0.23250 -0.63442 -0.18281 0.81851 -0.02353 0.03923 -0.51498 0.31890
[17] -0.60876 -0.30118 0.53728 -0.05494 0.28370 0.60876 -0.45163 -0.94502
[25] -0.99715 0.78301 -0.35514 0.16652 0.15034 -0.19923 0.30118 1.21969
[33] 0.99715 0.71870 -0.08649 0.00786 -0.28370 -1.05728 0.74987 -0.15034
[41] 0.56030 -1.57139 -0.74987 0.43153 0.39260 0.63442 -0.89871 0.08649
[49] 0.10234 -0.81851 -0.39260 0.94502 -0.13425 -0.03923 -0.47220 -0.07069
[57] 0.24938 0.33688 1.05728 -1.34615 -0.10234 -0.85686 0.07069 0.66118
[65] -0.41187 -1.21969 0.41187 0.68921 0.02353 -0.78301 -0.11826 -0.53728
[73] -0.71870 1.34615 0.58409 0.45163 0.37370 -0.56030 -0.00786 0.49330
[81] 0.19923 0.51498 -0.24938 1.57139 0.47220 0.85686 0.21579 -0.26644
[89] 0.05494 0.35514 -0.66118 -0.58409 0.89871 -0.31890 -0.68921 0.23250
[97] -0.37370 1.12907 -0.43153 -0.49330
$data$surv.time
[1] 0.1772 0.0858 0.3273 0.5311 1.4325 1.4688 0.1122 0.3026 0.8770 0.3910
[11] 1.1858 0.7370 0.2267 0.0698 0.2519 1.6764 1.7902 0.0692 0.4922 1.0174
[21] 0.5481 0.1440 1.1760 0.0331 0.2638 0.6286 0.5688 0.2527 0.3513 0.2334
[31] 0.5813 0.6132 0.0117 0.8969 0.8461 0.6515 0.6231 0.0576 0.8562 0.3821
[41] 0.6177 0.9645 1.5754 0.0204 0.5384 0.0881 1.6552 1.3080 0.7972 1.2041
[51] 0.6837 0.5931 0.0127 0.0372 0.4109 0.6632 1.7654 0.6298 0.9595 0.9056
[61] 0.1973 0.4166 0.3069 0.1548 0.3566 0.5638 1.3510 0.5246 0.8472 1.1544
[71] 0.3653 0.7238 0.2169 0.2382 1.3072 1.1605 0.0110 1.0911 0.5064 0.4733
[81] 0.3497 1.6239 0.4594 1.0946 0.3565 0.2532 0.5904 0.0307 0.3694 0.2448
[91] 0.4406 0.1704 0.1505 0.8269 0.5740 1.3492 1.0962 0.8613 0.4346 0.1761
$data$surv.event
[1] 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1
[38] 1 0 1 0 1 0 1 0 1 0 0 1 0 0 1 1 1 1 1 0 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1
[75] 1 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1
$data$weights
[1] 0.2216 0.6396 0.6263 0.5408 0.2409 0.2498 0.4677 0.8345 0.2339 0.7751
[11] 0.5216 0.3342 0.7785 0.2376 0.3367 0.4245 0.6981 0.6554 0.7220 0.1641
[21] 0.0507 0.5729 0.1142 0.0158 0.7772 0.2667 0.6802 0.2220 0.9742 0.6788
[31] 0.7816 0.6993 0.0104 0.5039 0.7311 0.3298 0.8205 0.8848 0.8560 0.4532
[41] 0.4704 0.5152 0.1638 0.8839 0.2006 0.6346 0.0442 0.3711 0.6038 0.9526
[51] 0.2149 0.1793 0.8670 0.4650 0.2269 0.9066 0.9721 0.9583 0.5477 0.9847
[61] 0.3485 0.3761 0.4203 0.2826 0.0665 0.0798 0.4328 0.9883 0.1130 0.2204
[71] 0.2203 0.6481 0.5093 0.7275 0.3159 0.8461 0.5062 0.6826 0.9444 0.0144
[81] 0.5211 0.8246 0.3281 0.6828 0.6177 0.6518 0.9562 0.2335 0.3297 0.8381
[91] 0.1450 0.9228 0.0869 0.6861 0.9677 0.6365 0.4205 0.8051 0.2604 0.6571
$data$strat
[1] 1 1 2 3 2 1 1 3 3 2 1 1 1 1 2 2 2 1 3 2 3 3 3 3 2 2 1 3 3 3 3 1 3 3 3 3 3
[38] 1 2 2 3 3 2 2 3 1 3 1 1 1 3 3 1 3 2 2 1 1 2 3 3 2 2 2 2 3 3 1 3 1 2 1 1 1
[75] 2 3 2 1 2 2 3 3 2 2 3 2 1 1 1 3 2 1 1 2 3 1 1 3 2 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.