Description Usage Arguments Details Value References Examples
This function estimates the NRI for competing risk prediction models
with time to event variable. coxph
object, survreg
object, predictors, and predicted risks can be used as input data for
the calculation.
The risk category based NRI and the risk difference based NRI can be
calculated.
Users can use several types of estimators to obtain point estimates of
the NRI and its components.
The percentile bootstrap method is used for an interval estimation.
1 2 3 4 |
time |
Vector of observed follow up times, X = \min(T, C). T is event time, and C is censoring time. |
event |
Vector of event indicators, 1 for event of interest, 0 for censoring. |
mdl.std, mdl.new |
|
z.std, z.new |
Matrix of predictors for a standard and a new risk prediction model, respectively. Neither factor nor character nor missing values are allowed. |
p.std, p.new |
Vector of predicted risks from a standard and a new prediction model, respectively. |
t0 |
Scalar value indicating a time to determine evnet/non-event. |
updown |
Character to specify the method to determine |
cut |
Scalar or vector values to specify the cutoff value(s) of predicted
risks for determining |
point.method |
Character to determine an estimator for a point estimation.
When |
niter |
Scalar value to determine the number of bootstratp sampling. When
|
alpha |
1-alpha confidence interval is calcualted. |
msg |
Logical value to display computation process.
Setting |
Either one set of the following arguments should be specified for the
NRI calculation: (mdl.std
, mdl.new
);
(time
, event
, z.std
, z.new
);
and (time
, event
, p.std
, p.new
).
In the first set of the argument, (mdl.std
, mdl.new
),
fitted results by coxph
or survreg
are used for the NRI
calculation.
time
, event
, z.std
, and z.new
are
extracted from fitted result objects.
The variance of model parameters are accounted for an interval
estimation of the NRI.
When time
and event
are specified in arguments,
those specified are used without extracting from coxph
or
survreg
objects.
In the second set of the argument, (time
, event
,
z.std
, z.new
), a standard and a new prediction models
are fitted inside this function with time
, event
,
z.std
and z.new
.
The variance of model parameters are also accounted for an interval
estimation of the NRI.
In the third set of the argument, (time
, event
,
p.std
, p.new
), predicted risks are used.
Since fit of prediction models are not conducted while in a bootstrap,
this can be used for a validation study by an external data source or
by a cross-validation.
For the risk category based NRI calculation, cutoff values of risk
category can be specified by cut
, which is a scalar for the
case of two risk categories and is a vector for the case of more than
two risk categories.
UP
and DOWN
are determined by the movement in risk
categories.
For the risk difference based NRI calculation, cutoff values of risk
difference can also be specified by cut
, where UP
and
DOWN
are defiend as p_{new} - p_{standard} > δ and
p_{standard} - p_{new} > δ, respectively.
p_{standard} and p_{new} are predicted individual risks
from a standard and a new prediction model, respectively, and
δ corresponds to cut
.
The continuous NRI, which is the special version of the risk
difference based NRI, can be calculated by specifying both
updown = "diff"
and cut = 0
.
Interval estimation is based on the percentile bootstrap method.
Returns a list of the following items:
nri |
Point and interval estimates of the NRI and its components. |
mdl.std, mdl.new |
Fitted |
z.std, z.new |
Predictors of a standard and a new prediction model, respectively.
These items are provided when they are extracted from |
p.std, p.new |
Predicted risks by a standard and a new prediction model, respectively. |
up, down |
Logical values to show subjects who belong to |
rtab, rtab.case, rtab.ctrl |
|
bootstrapsample |
Results of each bootstrap sample. |
Pencina MJ, D'Agostino RB, Steyerberg EW. Extensions of net reclassification improvement calculations to measure usefulness of new biomarkers. Statistics in Medicine 2011.
Uno H, Tian L, Cai T, Kohane IS, Wei LJ. A unified inference procedure for a class of measures to assess improvement in risk prediction systems with survival data, Statistics in Medicine 2012.
Hsu CH, Taylor JMG. A robust weighted Kaplan-Meier approach for data with dependent censoring using linear combinations of prognostic covariates, Statistics in Medicine 2010.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | ## here consider pbc dataset in survival package as an example
library(survival)
dat = pbc[1:312,]
dat$sex = ifelse(dat$sex=='f', 1, 0)
## predciting the event of 'death'
time = dat$time
event = ifelse(dat$status==2, 1, 0)
## standard prediction model: age, bilirubin, and albumin
z.std = as.matrix(subset(dat, select = c(age, bili, albumin)))
## new prediction model: age, bilirubin, albumin, and protime
z.new = as.matrix(subset(dat, select = c(age, bili, albumin, protime)))
## coxph fit
mstd = coxph(Surv(time,event) ~ ., data.frame(time,event,z.std), x=TRUE)
mnew = coxph(Surv(time,event) ~ ., data.frame(time,event,z.new), x=TRUE)
## predicted risk at t0=2000
p.std = get.risk.coxph(mstd, t0=2000)
p.new = get.risk.coxph(mnew, t0=2000)
## Calculation of risk category NRI
## by the KM estimator using ('mdl.std', 'mdl.std').
nricens(mdl.std = mstd, mdl.new = mnew, t0 = 2000, cut = c(0.2, 0.4),
niter = 0)
## by the KM estimator using ('time', 'event', 'z.std', 'z.std').
nricens(time = time, event = event, z.std = z.std, z.new = z.new,
t0 = 2000, cut = c(0.2, 0.4), niter = 0)
## by the KM estimator using ('time','event','p.std','p.std').
nricens(time = time, event = event, p.std = p.std, p.new = p.new,
t0 = 2000, cut = c(0.2, 0.4), niter = 0)
## Calculation of risk difference NRI by the KM estimator
nricens(mdl.std = mstd, mdl.new = mnew, t0 = 2000, updown = 'diff',
cut = 0.05, niter = 0)
## Calculation of risk difference NRI by the IPW estimator
nricens(mdl.std = mstd, mdl.new = mnew, t0 = 2000, updown = 'diff',
cut = 0.05, point.method = 'ipw', niter = 0)
|
Loading required package: survival
UP and DOWN calculation:
#of total, case, and control subjects at t0: 312 88 144
Reclassification Table for all subjects:
New
Standard < 0.2 < 0.4 >= 0.4
< 0.2 139 7 1
< 0.4 17 72 6
>= 0.4 0 5 65
Reclassification Table for case:
New
Standard < 0.2 < 0.4 >= 0.4
< 0.2 9 2 0
< 0.4 1 21 4
>= 0.4 0 0 51
Reclassification Table for control:
New
Standard < 0.2 < 0.4 >= 0.4
< 0.2 92 4 1
< 0.4 9 29 2
>= 0.4 0 3 4
NRI estimation by KM estimator:
Point estimates:
Estimate
NRI 0.11028068
NRI+ 0.05123381
NRI- 0.05904686
Pr(Up|Case) 0.06348538
Pr(Down|Case) 0.01225156
Pr(Down|Ctrl) 0.09583016
Pr(Up|Ctrl) 0.03678329
STANDARD prediction model (Cox model):
coef exp(coef) se(coef) z Pr(>|z|)
age 0.03726683 1.0379699 0.009048925 4.118371 3.815600e-05
bili 0.13531179 1.1448937 0.013711323 9.868617 0.000000e+00
albumin -1.44611854 0.2354825 0.221997986 -6.514107 7.312351e-11
NEW prediction model (Cox model):
coef exp(coef) se(coef) z Pr(>|z|)
age 0.03362675 1.0341985 0.009214173 3.649460 2.627925e-04
bili 0.12517886 1.1333511 0.014406820 8.688861 0.000000e+00
albumin -1.39395237 0.2480928 0.217046959 -6.422354 1.341831e-10
protime 0.28602917 1.3311313 0.070536400 4.055058 5.012193e-05
UP and DOWN calculation:
#of total, case, and control subjects at t0: 312 88 144
Reclassification Table for all subjects:
New
Standard < 0.2 < 0.4 >= 0.4
< 0.2 139 7 1
< 0.4 17 72 6
>= 0.4 0 5 65
Reclassification Table for case:
New
Standard < 0.2 < 0.4 >= 0.4
< 0.2 9 2 0
< 0.4 1 21 4
>= 0.4 0 0 51
Reclassification Table for control:
New
Standard < 0.2 < 0.4 >= 0.4
< 0.2 92 4 1
< 0.4 9 29 2
>= 0.4 0 3 4
NRI estimation by KM estimator:
Point estimates:
Estimate
NRI 0.11028068
NRI+ 0.05123381
NRI- 0.05904686
Pr(Up|Case) 0.06348538
Pr(Down|Case) 0.01225156
Pr(Down|Ctrl) 0.09583016
Pr(Up|Ctrl) 0.03678329
UP and DOWN calculation:
#of total, case, and control subjects at t0: 312 88 144
Reclassification Table for all subjects:
New
Standard < 0.2 < 0.4 >= 0.4
< 0.2 139 7 1
< 0.4 17 72 6
>= 0.4 0 5 65
Reclassification Table for case:
New
Standard < 0.2 < 0.4 >= 0.4
< 0.2 9 2 0
< 0.4 1 21 4
>= 0.4 0 0 51
Reclassification Table for control:
New
Standard < 0.2 < 0.4 >= 0.4
< 0.2 92 4 1
< 0.4 9 29 2
>= 0.4 0 3 4
NRI estimation by KM estimator:
Point estimates:
Estimate
NRI 0.11028068
NRI+ 0.05123381
NRI- 0.05904686
Pr(Up|Case) 0.06348538
Pr(Down|Case) 0.01225156
Pr(Down|Ctrl) 0.09583016
Pr(Up|Ctrl) 0.03678329
UP and DOWN calculation:
#of total, case, and control subjects at t0: 312 88 144
#of subjects with 'p.new - p.std > cut' for all, case, control: 34 21 11
#of subjects with 'p.std - p.new < cut' for all, case, control: 40 12 8
NRI estimation by KM estimator:
Point estimates:
Estimate
NRI 0.10070960
NRI+ 0.05097223
NRI- 0.04973737
Pr(Up|Case) 0.22431499
Pr(Down|Case) 0.17334277
Pr(Down|Ctrl) 0.10859064
Pr(Up|Ctrl) 0.05885327
UP and DOWN calculation:
#of total, case, and control subjects at t0: 312 88 144
#of subjects with 'p.new - p.std > cut' for all, case, control: 34 21 11
#of subjects with 'p.std - p.new < cut' for all, case, control: 40 12 8
NRI estimation by IPW estimator:
Point estimates:
Estimate
NRI 0.06361038
NRI+ 0.08444371
NRI- -0.02083333
Pr(Up|Case) 0.22905909
Pr(Down|Case) 0.14461537
Pr(Down|Ctrl) 0.05555556
Pr(Up|Ctrl) 0.07638889
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.