View source: R/predict_weights_dataframe.R
predict_weights | R Documentation |
The function
predict_weights
predicts weights of samples in terminal nodes based on a survival tree fit.
predict_weights(
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 Weights of Samples in Terminal Nodes Based on a Survival Tree Fit (Data Supplied as a Dataframe)
A weight matrix representing 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_weight<-
predict_weights(
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.