predict_distance_tree {SurvivalClusteringTree} | R Documentation |
Predict Distances Between Samples Based on a Survival Tree Fit (Data Supplied as a Dataframe)
Description
The function
predict_distance_tree
predicts distances between samples based on a survival tree fit.
Usage
predict_distance_tree(
survival_tree,
numeric_predictor,
factor_predictor,
data,
missing = "omit"
)
Arguments
survival_tree |
a fitted survival tree |
numeric_predictor |
a formula specifying the numeric predictors.
As in |
factor_predictor |
a formula specifying the numeric predictors.
As in |
data |
the dataframe (test data) that stores the outcome and predictor variables.
Variables in the global environment will be used if |
missing |
a character value that specifies the handling of missing data.
If |
Details
Predict Distances Between Samples Based on a Survival Tree Fit (Data Supplied as a Dataframe)
Value
A list.
node_distance
gives the distance matrix between nodes.
ind_distance
gives the distance matrix between samples.
ind_weights
gives the weights of samples in each node.
Examples
library(survival)
a_survival_tree<-
survival_tree(
survival_outcome=Surv(time,status==2)~1,
numeric_predictor=~age+ph.ecog+ph.karno+pat.karno+meal.cal,
factor_predictor=~as.factor(sex),
data=lung)
a_distance<-
predict_distance_tree(
a_survival_tree,
numeric_predictor=~age+ph.ecog+ph.karno+pat.karno+meal.cal,
factor_predictor=~as.factor(sex),
data=lung)