survival_forest_matrix {SurvivalClusteringTree}R Documentation

Build a Survival Forest (Data Supplied as Matrices)

Description

The function survival_forest_matrix build a survival forest given the survival outcomes and predictors of numeric and factor variables.

Usage

survival_forest_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,
  nboot = 100,
  seed = 0
)

Arguments

time

survival times, a numeric vector. time[i] is the survival time of the ith sample.

event

survival events, a logical vector. event[i] is the survival event of the ith sample.

matrix_numeric

numeric predictors, a numeric matrix. matrix_numeric[i,j] is the jth numeric predictor of the ith sample.

matrix_factor

factor predictors, a character matrix. matrix_factor[i,j] is the jth predictor of the ith sample.

weights

sample weights, a numeric vector. weights[i] is the weight of the ith sample.

significance

significance threshold, a numeric value. Stop the splitting algorithm when no splits give a p-value smaller than significance.

min_weights

minimum weight threshold, a numeric value. The weights in a node are greater than min_weights.

missing

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.

test_type

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.

cut_type

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.

nboot

an integer value that specifies the number of bootstrap replications.

seed

an integer value that specifies the seed.

Details

Build a Survival Forest (Data Supplied as Matrices)

Value

A list containing the information of the survival forest fit.

Examples


library(survival)
a_survival_forest<-
  survival_forest_matrix(
    time=lung$time,
    event=lung$status==2,
    matrix_numeric=data.matrix(lung[,c(4,6:9),drop=FALSE]),
    matrix_factor=data.matrix(lung[,5,drop=FALSE]),
    nboot=20)


[Package SurvivalClusteringTree version 1.1 Index]