uni.tree: A survival binary tree split by univariate selection and the...

Description Usage Arguments Details Value References Examples

View source: R/uni.tree.R

Description

Using a survival dataset to build a tree. The decision of splitting is using score test or log-rank test. And the threshold of stop spltting can fixed through the argument. This function also produce a relative risk rank between the terminal nodes.

Usage

1
2
3
4
5
6
7
8
9
uni.tree(
  t.vec,
  d.vec,
  X.mat,
  P.value = 0.01,
  d0 = 0.01,
  S.plot = FALSE,
  score = TRUE
)

Arguments

t.vec

:Vector of survival times (time to either death or censoring)

d.vec

:Vector of censoring indicators (1=death, 0=censoring)

X.mat

:n by p matrix of covariates, where n is the sample size and p is the number of covariates

P.value

:the threshold of P-value for stop splitting (stopping criterion)

d0

:A positive constant to stabilize the variance of score statistics (Witten & Tibshirani 2010)

S.plot

:call for plot the KM estimator for each split

score

:TRUE = score test (Emura T et al. 2019); FALSE = log-rank test

Details

the concept is generated by a function containing the function itself

For each split, we record three things, fist is the information of inner node which contains what to choose for splitting and what value the p-value the two sample test is. Second and third are the information of left and right children nodes. If the children node is decided to become a inner node, then it genertae another two nodes;otherwise, it becomes a terminal node and record the information of sample size and the covariate space and the p-value it try to split but is failed

Value

A nesting list of tree, containing inner node and terminal node information

References

Emura T, Matsui S, Chen HY (2019). compound.Cox: Univariate Feature Selection and Compound Covariate for Predicting Survival, Computer Methods and Programs in Biomedicine 168: 21-37.

Witten DM, Tibshirani R (2010) Survival analysis with high-dimensional covariates. Stat Method Med Res 19:29-51

Examples

1
2
3
4
5
6
data(Lung,package="compound.Cox")
train_Lung=Lung[which(Lung[,"train"]==TRUE),] #select training data
t.vec=train_Lung[,1]
d.vec=train_Lung[,2]
x.mat=train_Lung[,-c(1,2,3)]
uni.tree(t.vec,d.vec,x.mat,P.value=0.01,d0=0.01,S.plot=FALSE,score=TRUE)

lichkeam/uni.survival.tree documentation built on Dec. 21, 2021, 10:46 a.m.