measure {icrf} | R Documentation |
Prediction error measures
Description
This function measures the prediction errors including the IMSE (integrated mean squared error) of type 1 and 2, the integrated absolute error, and the supremum absolute error. When the true survival curve is unknown but the observed interval is available, IMSE is used. When the true survival curve is known, the integrated and supremum absolute errors are used.
Usage
measure(
surv.hat,
timepoints,
tau,
method = c("all", "imse", "int.error"),
L = NULL,
R = NULL,
surv.true = NULL
)
Arguments
surv.hat |
the estimated survival curve matrix with rows representing the observations and the columns representing the time points at which the survival curve is estimated. |
timepoints |
a vector of time points at which the survival curve is estimated. |
tau |
the study end time. ([0, |
method |
Which measure will be used? Either |
L , R |
the left and right interval endpoints. These are required when |
surv.true |
the true survival curve matrix with rows representing
the observations and the columns representing the time points at which the
survival curve is evaluated. This is required when |
Details
For details of the error measures, see Cho H., Jewell N. J., and Kosorok M. R. (2020+). "Interval censored recursive forest"
Value
A vector of prediction errors:
-
imse.type1
andimse.type2
whenmethod == "imse"
-
int.error
andsup.error
whenmethod == "int.error"
-
imse.type1
,imse.type2
,int.error
, andsup.error
whenmethod == "all"
Author(s)
Hunyong Cho hunycho@live.unc.edu, based on the code and the documents of
randomForest
by Andy Liaw and Matthew Wiener.
References
Cho H., Jewell N. J., and Kosorok M. R. (2020+). "Interval censored recursive forests"
Examples
# rats data example.
# Note that this is a toy example. Use a larger ntree and nfold in practice.
library(survival) # for Surv()
data(rat2)
L = ifelse(rat2$tumor, 0, rat2$survtime)
R = ifelse(rat2$tumor, rat2$survtime, Inf)
set.seed(1)
rats.icrf <-
icrf(Surv(L, R, type = "interval2") ~ dose.lvl + weight + male + cage.no,
data = rat2, ntree = 10, nfold = 3)
measure(rats.icrf$predicted.Sm, timepoints = rats.icrf$time.points,
tau = rats.icrf$tau, method = "imse", L = L, R = R)