hesim-dev / hesim

Health economic simulation modeling and decision analysis
https://hesim-dev.github.io/hesim/
62 stars 15 forks source link

Is it possible to add different treatment costs to the different health states within the same treatment group? #99

Closed Djema1406 closed 1 year ago

Djema1406 commented 1 year ago

Is it possible to add different treatment costs to the different health states within the same treatment group? I am following the tutorial for the simple Markov cohort with hesim. The treatmet costs for the new treatment and SoC are the same across health states. I would like it add a profylacftic treament. Only the patients in the healthy (H) state have a treatment cost and the other states do not. Is it possible to add this?

example code:

params <- list(
  alpha_soc = transitions_soc,
  c_medical = c(H = 0, S1 = 50, S2 = 100),
  c_soc = 5,
  c_new = 10,
  u_mean = c(H = 1, S1 = 5, S2 = 3),
  u_se = c(H = 0, S1 = 0.05, S2 = 0.05)
)

If I treat the c_soc and c_new as the c_medical (by vectorising) I get the following error message in create_CohortDtstm():

Error in if ((is.numeric(out) && length(dim(out)) <= 1) || ncol(out) ==  : 
  missing value where TRUE/FALSE needed
dincerti commented 1 year ago

Hi @Djema1406 I apologize for the delayed response. Are you still have any issue with this? What you are asking about should indeed be possible.