View source: R/predict_distance_tree_dataframe.R
predict_distance_tree | R Documentation |
The function
predict_distance_tree
predicts distances between samples based on a survival tree fit.
predict_distance_tree(
survival_tree,
numeric_predictor,
factor_predictor,
data,
missing = "omit"
)
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 |
Predict Distances Between Samples Based on a Survival Tree Fit (Data Supplied as a Dataframe)
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.