measure | R Documentation |
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.
measure( surv.hat, timepoints, tau, method = c("all", "imse", "int.error"), L = NULL, R = NULL, surv.true = NULL )
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 |
For details of the error measures, see Cho H., Jewell N. J., and Kosorok M. R. (2020+). "Interval censored recursive forest"
A vector of prediction errors:
imse.type1
and imse.type2
when method == "imse"
int.error
and sup.error
when method == "int.error"
imse.type1
, imse.type2
, int.error
, and sup.error
when method == "all"
Hunyong Cho hunycho@live.unc.edu, based on the code and the documents of
randomForest
by Andy Liaw and Matthew Wiener.
Cho H., Jewell N. J., and Kosorok M. R. (2020+). "Interval censored recursive forests"
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.