| importance | R Documentation |
Extracts and organizes variable importance scores from the fitted random forest models for each transition. These are ranger permutation-importance scores based on edge-specific OOB predictive loss, not causal effects.
importance(object, ...)
## S3 method for class 'rfmstate'
importance(object, ...)
object |
A fitted |
... |
Ignored. |
Values are transition-specific and may have different effective sample sizes. Negative values can arise from Monte Carlo variation, sparse events, correlated predictors, or noise; they do not indicate protective or causal effects. Repeated seeds/resamples are needed to assess stability.
An object of class "rfmstate_importance" containing:
Data frame with columns variable,
from, to, transition, n_events, and
importance.
Matrix with variables as rows and transitions as columns.
Covariate names.
Character vector of transition labels.
Importance describes transition-specific predictive contribution under the
fitted ranger endpoint. Values are not causal effects, are not directly
comparable across edges with different risk sets/event counts, and do not
validate the assembled full-state probability model. Models fitted with
importance = "none" return unavailable values.
ms <- clinical_states()
dat <- sim_clinical_data(n = 200, structure = ms, seed = 42)
msdata <- prepare_data(
data = dat, id = "ID", structure = ms,
time_map = list(
Responded = "time_Responded",
Unresponded = "time_Unresponded",
Stabilized = "time_Stabilized",
Progressed = "time_Progressed",
Death = "time_Death"
),
censor_col = "time_censored",
covariates = c("age", "sex", "BMI", "treatment")
)
fit <- rfmstate(msdata, num.trees = 100, seed = 42)
imp <- importance(fit)
print(imp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.