stree: Recursive partitioning based survival tree

Description Usage Arguments Details Value References See Also Examples

View source: R/stree.R

Description

Fit a stree model for censored data

Usage

1

Arguments

data

input data, including a time response, a censoring indicator (‘1’ for acensored time and ‘0’ for an observed time), and at least one nominal or ordinal variable, and typically more covariates of either type.

family

the splitting rule for an internal node in a survival tree. It includes five choices: ‘likelihood’, ‘log-rank’, ‘kaplan-meier distance’, ‘adaptive normalization’, and ‘global normalization’

Details

stree uses five rules which can be chosen by users to create a survival tree based on censored data. Data format is required to include at least one column of response variable, one column of censored variable, one column of nominal or ordinal variable. Given data and chosen family, it will produce an 'stree' object that can be used for plot.stree, kmgraph and other further analysis like prediction. The 'stree' object will include necessary properties of the tree.

Value

nnd

the total number of nodes in the tree.

dt

the sequence number of a left daughter node for each internal node.

pt

the sequence number of the parent node for any daughter node.

spv

the splitting variable used to split a given node.

spvl

the cut-off value of the splitting variable above.

ncases

the number of observations in each node.

death_catg

the number of deaths in each node.

median

the median survival time in each node.

colname

a numerical indicator for the category of each variable. Value ‘-2' points to the response variable, ‘1' to oridinal variables, ‘2' to a nominal variable, ‘-1' to censoring indicator.

call

the call by which this object is generated.

learning.data

the data that are actually used in stree.

References

Zhang, H. and Singer, B. (1999) Recursive partitioning in the health sciences. Springer Verlag.

See Also

plot.stree, forecast.stree, kmgraph

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
test <- data.frame(runif(1000, 1, 10), rbinom(1000, 1, 0.5),
                 sample(1:4, 1000, replace = TRUE, prob = c(0.1, 0.3, 0.2, 0.4)),
                 sample(1:50, 1000, replace = TRUE),
                 sample(1:30, 1000, replace = TRUE),
                 sample(1:10, 1000, replace = TRUE),
                 sample(1:60, 1000, replace = TRUE),
                 sample(1:20, 1000, replace = TRUE),
                 sample(1:40, 1000, replace = TRUE))
test[,3] <- as.factor(test[,3])
 result <- stree(test, "likelihood")
plot(result)

macs documentation built on Oct. 9, 2019, 5:05 p.m.

Related to stree in macs...