predict_distance_forest {SurvivalClusteringTree} | R Documentation |
Predict Distances Between Samples Based on a Survival Forest Fit (Data Supplied as a Dataframe)
Description
The function
predict_distance_forest
predicts distances between samples based on a survival forest fit.
Usage
predict_distance_forest(
survival_forest,
numeric_predictor,
factor_predictor,
data,
missing = "omit"
)
Arguments
survival_forest |
a fitted survival forest |
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 Forest Fit (Data Supplied as a Dataframe)
Value
A list.
mean_distance
is the mean distance matrix.
sum_distance
is the matrix that sums the distances between samples.
sum_non_na
is the matrix of the number of non NA distances being averaged.
Examples
library(survival)
a_survival_forest<-
survival_forest(
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,nboot=20)
a_distance<-
predict_distance_forest(
a_survival_forest,
numeric_predictor=~age+ph.ecog+ph.karno+pat.karno+meal.cal,
factor_predictor=~as.factor(sex),
data=lung)