Skip to contents

This function calculates the state membership (Markov trace) for different health states based on predicted survival curves.

Usage

calculate_markov_trace(df_survival_curves_long)

Arguments

df_survival_curves_long

A data frame containing the predicted cumulative survival curves in long format with columns for time, treatment, end_point, and survival probabilities.

Value

A data frame in wide format with columns for time, treatment, and states occupancy (`EFS`, `PPS`, `D`).

Examples

if (FALSE) {
# Load the fitted Gompertz model parameters
models_fit <- NeuroblastomaPSM::parametric_models

# Define model parameters
params <- c(
  time_horizon = 10,
  cycle_length = 1/12,
  disc_rate_costs = 0.035,
  disc_rate_qalys = 0.015,
  NeuroblastomaPSM::l_psm_parameters
)

# Predict cumulative survival
df_survival_curves_long <- NeuroblastomaPSM::predict_cumulative_survival(
  models_fit = models_fit,
  l_params = params
)

# Generate Markov trace
df_markov_trace <- NeuroblastomaPSM::calculate_markov_trace(
  df_survival_curves_long = df_survival_curves_long
)

rbind(
  head(df_markov_trace, n = 5),
  tail(df_markov_trace, n = 5)
)
}