Interpolate Survival / CDF / CIF Matrices
mat_interp.Rd
Wrapper around the internal C++ interpolation function c_mat_interp
.
Performs input validation before calling the underlying C++ code.
Can be used for survival, cumulative distribution (CDF), or cumulative
incidence (CIF) matrices.
Usage
mat_interp(
x,
times = NULL,
eval_times = NULL,
constant = TRUE,
type = "surv",
add_times = TRUE,
check = TRUE
)
Arguments
- x
(
matrix()
)
Survival/CDF/CIF matrix with rows as observations and columns as time points.- times
(
numeric()
|NULL
)
Original time points corresponding to columns ofx
.- eval_times
(
numeric()
|NULL
)
New time points at which to interpolate. Values do not need to be sorted or unique, just non-negative. IfNULL
,x
is returned unchanged.- constant
(
logical(1)
)
IfTRUE
(default), use piecewise-constant (left-continuous) interpolation. IfFALSE
, use piecewise-linear interpolation.- type
(
character(1)
)
One of"surv"
(default),"cdf"
, or"cif"
, indicating the input data type.- add_times
(
logical(1)
)
IfTRUE
(default), column names are set to the relevant time points.- check
(
logical(1)
)
IfTRUE
, run input matrix validation viaassert_prob_matrix()
; set toFALSE
to skip checks (NOT recommended for external use).