nricens-package: R Functions to calculate NRI for comparing time to event and...

Description Details Author(s) References Examples

Description

This package provides the functions to estimate the net reclassification improvement (NRI) for competing risk prediction models with time to event and binary response data. The NRI for binary response models can be calculated by nribin, and that for time to event models can be calculated by nricens. The risk category based NRI and the risk difference based NRI are provided by these functions. Users can use several estimators for comparing time to event models. Confidence intervals are calculated by the percentile bootstrap method. In this version, several types of input data are allowed to improve user-friendliness and convenience.

Details

Package: nricens
Type: Package
Version: 1.6
Date: 2018-5-30
License: GPL-2

Author(s)

Eisuke Inoue <eisuke.inoue@marianna-u.ac.jp>

References

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.

Examples

 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
44
45
46
47
48
## 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)))

## fitting cox models
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)

## Calculation of the risk category NRI at 2000 days
nricens(mdl.std = mstd, mdl.new = mnew, t0 = 2000, cut = c(0.2, 0.4),
        niter = 10)


## Next, consider binary prediction models
library(survival)
dat = pbc[1:312,]
dat$sex = ifelse(dat$sex=='f', 1, 0)

## subjects censored before 2000 days are excluded
dat = dat[ dat$time > 2000 | (dat$time < 2000 & dat$status == 2), ]

## predciting the event of 'death' before 2000 days
event = ifelse(dat$time < 2000 & 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)))

## glm fit (logistic model)
mstd = glm(event ~ ., binomial(logit), data.frame(event, z.std), x=TRUE)
mnew = glm(event ~ ., binomial(logit), data.frame(event, z.new), x=TRUE)

## Calculation of risk difference NRI
nribin(mdl.std = mstd, mdl.new = mnew, cut = 0.02, niter = 0,
       updown = 'diff')

Example output

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

Now in bootstrap..

Point & Interval estimates:
                Estimate        Lower      Upper
NRI           0.11028068 -0.033516353 0.16334470
NRI+          0.05123381 -0.065198561 0.05234325
NRI-          0.05904686 -0.006110897 0.14126275
Pr(Up|Case)   0.06348538  0.009988672 0.10924815
Pr(Down|Case) 0.01225156  0.000000000 0.11899427
Pr(Down|Ctrl) 0.09583016  0.049298171 0.18906492
Pr(Up|Ctrl)   0.03678329  0.021806755 0.09338129

UP and DOWN calculation:
  #of total, case, and control subjects at t0:  232 88 144
  #of subjects with 'p.new - p.std > cut' for all, case, control: 34 17 17
  #of subjects with 'p.std - p.new < cut' for all, case, control: 36 13 23

NRI estimation:
Point estimates:
                Estimate
NRI           0.04310345
NRI+          0.01724138
NRI-          0.02586207
Pr(Up|Case)   0.07327586
Pr(Down|Case) 0.05603448
Pr(Down|Ctrl) 0.09913793
Pr(Up|Ctrl)   0.07327586

nricens documentation built on May 2, 2019, 6:01 a.m.