@@ -64,13 +64,16 @@ n_age_max <- 100 # maximum age of follow up
6464n_t <- n_age_max - n_age_init # time horizon, number of cycles
6565v_names_states <- c(" H" , " S1" , " S2" , " D" ) # the 4 health states of the model:
6666 # Healthy (H), Sick (S1), Sicker (S2), Dead (D)
67- v_hcc <- rep(1 , n_t + 1 ) # vector of half-cycle correction
68- v_hcc [1 ] <- v_hcc [n_t + 1 ] <- 0.5 # half-cycle correction weight
6967n_states <- length(v_names_states ) # number of health states
68+ # Discounting factors
7069d_c <- 0.03 # discount rate for costs
7170d_e <- 0.03 # discount rate for QALYs
71+ # Strategies
7272v_names_str <- c(" SoC" , " A" , " B" , " AB" ) # store the strategy names
7373n_str <- length(v_names_str ) # number of strategies
74+ # Within-cycle correction (WCC) using Simpson's 1/3 rule
75+ v_wcc <- darthtools :: gen_wcc(n_t = n_t , method = " Simpson1/3" ) # vector of wcc
76+
7477
7578# # Transition probabilities (per cycle), hazard ratios and odds ratio
7679r_HD <- 0.002 # constant rate of dying when Healthy (all-cause mortality)
@@ -318,9 +321,9 @@ for (i in 1:n_str) {
318321
319322 # ### Discounted total expected QALYs and Costs per strategy and apply half-cycle correction if applicable ####
320323 # # QALYs
321- v_tot_qaly [i ] <- t(v_qaly_str ) %*% (v_dwe * v_hcc )
324+ v_tot_qaly [i ] <- t(v_qaly_str ) %*% (v_dwe * v_wcc )
322325 # # Costs
323- v_tot_cost [i ] <- t(v_cost_str ) %*% (v_dwc * v_hcc )
326+ v_tot_cost [i ] <- t(v_cost_str ) %*% (v_dwc * v_wcc )
324327}
325328
326329# ######################### Cost-effectiveness analysis #######################
0 commit comments