The function
survival_tree_matrix
build a survival tree given the survival outcomes and predictors of numeric and factor variables.
survival_tree_matrix(
time,
event,
matrix_numeric,
matrix_factor,
weights = rep(1, length(time)),
significance = 0.05,
min_weights = 50,
missing = "omit",
test_type = "univariate",
cut_type = 0
)
A list containing the information of the survival tree fit.
survival times, a numeric vector.
time[i]
is the survival time of the ith sample.
survival events, a logical vector.
event[i]
is the survival event of the ith sample.
numeric predictors, a numeric matrix.
matrix_numeric[i,j]
is the jth numeric predictor of the ith sample.
factor predictors, a character matrix.
matrix_factor[i,j]
is the jth predictor of the ith sample.
sample weights, a numeric vector.
weights[i]
is the weight of the ith sample.
significance threshold, a numeric value.
Stop the splitting algorithm when no splits give a p-value smaller than significance
.
minimum weight threshold, a numeric value.
The weights in a node are greater than min_weights
.
a character value that specifies the handling of missing data.
If missing=="omit"
, samples with missing values in the splitting variables will be discarded.
If missing=="majority"
, samples with missing values in the splitting variables will be assigned to the majority node.
If missing=="weighted"
, samples with missing values in the splitting variables will be weighted by the weights of branch nodes.
a character value that specifies the type of statistical tests.
If test_type=="univariate"
, then it performs a log-rank test without p-value adjustments.
If test_type
is in p.adjust.methods
, i.e., one of holm, hochberg, hommel, bonferroni, BH, BY, or fdr,
then the p-values will be adjusted using the corresponding method.
an integer value that specifies how to cut between two numeric values.
If cut_type==0
, then cut at the ends.
If cut_type==1
, then cut from the middle.
If cut_type==2
, then cut randomly between the two values.
Build a Survival Tree (Data Supplied as Matrices)