| data_model_output_sick_sicker | R Documentation |
This data structure with several lists and vectors collecting a subset of the model outputs from the Sick-Sicker model intended for demonstrating the discounting in this package. The full model is described in the DARTH “Sick-Sicker” example. Source code can be found here: https://github.com/DARTH-git/cohort-modeling-tutorial-intro
data_model_output_sick_sicker
An object of class list of length 9.
For the full reference read: Alarid-Escudero F, Krijkamp EM, Enns EA, Yang A, Hunink MGM, Pechlivanoglou P, Jalal H. An Introductory Tutorial on Cohort State-Transition Models in R Using a Cost-Effectiveness Analysis Example. Medical Decision Making, 2023;43(1):3-20. https://doi.org/10.1177/0272989X221103163
These data can be used for demonstrating how to apply some of the package functions like discounting for the results of a model-based cost-effectiveness model.
#' @format A list with the following components
Annual transition matrix for sick-sicker model.
Monthly transition matrix for sick-sicker model.
Half-cycle correction weights for annual model.
Half-cycle correction weights for monthly model.
Names of the intervention strategies used in the model.
Annual utilities for each health state.
Monthly utilities for each health state.
Annual costs for each health state.
Monthly costs for each health state.
# Load the dataset
data("data_model_output_sick_sicker.rda")
# Load list in global environment
list2env(data_model_output_sick_sicker, envir = .GlobalEnv)
# Explore the available objects
ls(pattern = "l_|v_")
# View names of health states
v_names_str
# Inspect the first few cycles of the annual Markov trace for the first strategy
head(l_m_M_annual[[1]])
# Compare dimensions of annual and monthly traces
dim(l_m_M_annual[[1]])
dim(l_m_M_monthly[[1]])
# Apply the half cycle correction
## Loop through each strategy and calculate total utilities and costs ----
v_tot_qaly <- v_tot_cost <- c()
for (i in 1:length(v_names_str)) {
v_u_str <- l_u_monthly[[i]] # select the vector of state utilities for the i-th strategy
v_c_str <- l_c_monthly[[i]] # select the vector of state costs for the i-th strategy
###* Expected QALYs and costs per cycle
##* Vector of QALYs and Costs
#* Apply state rewards
v_qaly_str <- l_m_M_monthly[[i]] %*% v_u_str # sum the utilities of all states for each cycle
v_cost_str <- l_m_M_monthly[[i]] %*% v_c_str # sum the costs of all states for each cycle
###* Total expected QALYs and costs per strategy and apply half-cycle correction (if applicable)
#* QALYs
v_tot_qaly[i] <- t(v_qaly_str) %*% v_wcc_monthly
#* Costs
v_tot_cost[i] <- t(v_cost_str) %*% v_wcc_monthly
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.