coxph.tree {TimeVTree} | R Documentation |
Function to Grow the Tree Using the Score Statistic
Description
This funtion finds the optimal cutpoints for the time-varying regression effects and grows the 'full tree' using the score statistic.
Usage
coxph.tree(survtime, survstatus, x, D = 3, method = "breslow", minfail = 10,
iter.max = 20, eps = 1e-06, type = 'mod')
Arguments
survtime |
survival time/ follow up time of subjects |
survstatus |
survival status of subjects. 0 for censored and 1 for event |
x |
a data frame of covariates. In case of single covariate, use |
D |
maximum depth the tree will grow. Default depth is 3. |
method |
argument for coxph function. Default is 'breslow'. See |
minfail |
minimum number of unique events required in each block. Default is 10 |
iter.max |
the maximum number of iteration in coxph; default is 20. See |
eps |
argument for coxph function; default is 0.000001. See |
type |
method to calculate the score statistic. Two options are available: 'mod' for the modified score statistic and 'ori' for the original score statistic. Default value is 'mod.' Modified score statistic is used in the bootstrap part |
Details
coxph.tree
takes in survival time, survival status, and covariates to grow the full tree.
It follows one of the stopping rules: 1) when the pre-specified depth is reached, or 2) the number of events in a node is less than a prespecified number, or 3) the maximized score statistic is less than a default value (0.0001).
Currently, data need to be arranged in descending order of time and with no missing.
Value
coxph.tree
returns an object of class 'coxphtree.'
The function output.coxphout
is used to obtain and print a summary of the result.
An object of class 'coxphtree' is a list containing the following components:
D |
Depth value specified in the argument |
coef |
coefficient values of predictors. First number represents depth and second number represents block number |
lkl |
Likelihood ratio value of each node |
breakpt |
Starting point of each node. Starting point of node at Depth= 0 to maximum Depth = D+1 is shown. |
ntree |
Number of cases in each node |
nevent |
Number of events in each node |
nblocks |
Number of blocks in each depth |
nodes |
Indicator that indicates whether the block was eligible for further split |
nodetree |
A table with depth, block, node, left right, maximum score, start time, end time, # of cases, and # of events |
scoretest |
Maximum score at each block |
xnames |
Name of predictors |
failtime |
The time when events occurred without duplicates |
summary |
|
pvalue |
p-value to test validity of a change point against none |
References
Xu, R. and Adak, S. (2002), Survival Analysis with Time-Varying Regression Effects Using a Tree-Based Approach. Biometrics, 58: 305-315.
Examples
##Call in alcohol data set
data('alcohol')
require(survival)
coxtree <- coxph.tree(alcohol[,'time'], alcohol[,'event'],
x = alcohol[,'alc', drop = FALSE], D = 4)
nodetree <- output.coxphout(coxtree)
subtrees <- prune(nodetree)