Checks the structure, cause names, and probabilities of a list of cumulative incidence function (CIF) matrices. This is the format used by PredictionCompRisks to store predictions for competing events.
Arguments
- x
(
list())
A list of at least two numeric matrices, one per competing event. List names must be exactly"1","2", ...,"K", in that order, whereKis the number of matrices. Rows represent observations, and columns represent time points.- n_rows
(
integer(1)|NULL)
Expected number of observations in each matrix. IfNULL, no specific row count is required.- causes
(
character()|NULL)
Expected competing event names:"1","2", ...,"K", in that order. If supplied, these must match the list names exactly. IfNULL, the expected names are determined from the length ofx.
Details
Each matrix is checked with survdistr::assert_prob() using type = "cif":
At least one row and one column are required, and missing values are not allowed.
Column names must represent unique, increasing, non-negative numeric time points.
Probabilities must be between 0 and 1 and non-decreasing over time within each row.
If time 0 is included, its probabilities must all be 0.
Matrices are checked individually and may use different time grids.
