sbrier_IC: Model Fit For Interval-Censored Data

Description Usage Arguments Value References Examples

View source: R/sbrier_IC.R

Description

Compute the (integrated) Brier score to evaluate the model fit for interval-censored survival data.

Usage

1
2
3
4
5
6
sbrier_IC(
  obj,
  pred,
  btime = range(as.numeric(obj[, 1:2])),
  type = c("IBS", "BS")
)

Arguments

obj

an object of class Surv.

pred

predicted values. This can be a matrix of survival probabilities evaluated at a sequence of time points for a set of new data, a list of survfit objects, a list ic_np objects, or a list of ic_sp objects.

btime

a vector of length two indicating the range of times that the scores are computed on. The default btime is set to be the vector of the smallest and the largest values among all left and right endpoints given in obj.

type

a character string denoting the type of scores returned. For "IBS", the integrated Brier score over the btime is returned. For "BS", the Brier score at every left and right endpoint of all censoring intervals that lie within btime is returned.

Value

If type = "IBS", this returns the integrated Brier score.

If type = "BS", this returns the Brier scores.

References

S. Tsouprou. Measures of discrimination and predictive accuracy for interval-censored data. Master thesis, Leiden University. https://www.math.leidenuniv.nl/scripties/MasterTsouprou.pdf.

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
### Example with dataset miceData
library(survival)
library(icenReg)
data(miceData)

## For proper evaluation, Inf should be set to be a large number, for example, 9999999.
idx_inf <- (miceData$u == Inf)
miceData$u[idx_inf] <- 9999999.

obj <- Surv(miceData$l, miceData$u, type = "interval2")

## Model fit for an NPMLE survival curve with survfit
pred <- survival::survfit(formula = Surv(l, u, type = "interval2") ~ 1, data = miceData)
# Integrated Brier score up to time = 642
sbrier_IC(obj, pred, btime = c(0, 642), type = "IBS")

## Model fit for a semi-parametric model with icenReg::ic_sp()
pred <- icenReg::ic_sp(formula = Surv(l, u, type = "interval2") ~ 1, data = miceData)
# Integrated Brier score up to the largest endpoints of all censoring intervals in the dataset
sbrier_IC(obj, pred, type = "IBS")

## Model fit for an NPMLE survival curve with icenReg::ic_np()
pred <- icenReg::ic_np(miceData[,c('l', 'u')])
# Brier score computed at every left and right endpoints of all censoring intervals in the dataset
sbrier_IC(obj, pred, type = "BS")

ICcforest documentation built on Feb. 17, 2020, 9:07 a.m.