KM.split {uni.survival.tree}R Documentation

Kaplan-Meier estimator of binary splitting

Description

Given a cut-off-point and selected covariate, return the survival curve for binary classification and the P-value of two sample log-rank test.

Usage

KM.split(t.vec, d.vec, X.mat, x.name, cutoff)

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

x.name

:the name of covariate

cutoff

:cut-off-point

Value

P-value of two sample logrank test and a plot of two KM estimates

Examples

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)]
KM.split(t.vec,d.vec,x.mat,x.name="ANXA5",cutoff=1)

[Package uni.survival.tree version 1.5 Index]