# NOT RUN {
# simulation output
n_samples <- 100
sim <- data.frame(sample = rep(seq(n_samples), 4),
c = c(rlnorm(n_samples, 5, .1), rlnorm(n_samples, 5, .1),
rlnorm(n_samples, 11, .1), rlnorm(n_samples, 11, .1)),
e = c(rnorm(n_samples, 8, .2), rnorm(n_samples, 8.5, .1),
rnorm(n_samples, 11, .6), rnorm(n_samples, 11.5, .6)),
strategy = rep(paste0("Strategy ", seq(1, 2)),
each = n_samples * 2),
grp = rep(rep(c("Group 1", "Group 2"),
each = n_samples), 2)
)
# icea
icea <- icea(sim, k = seq(0, 200000, 500), sample = "sample", strategy = "strategy",
grp = "grp", e = "e", c = "c")
names(icea)
# The probability that each strategy is the most cost-effective
# in each group with a willingness to pay of 20,000
library("data.table")
icea$mce[k == 20000]
# icea_pw
icea_pw <- icea_pw(sim, k = seq(0, 200000, 500), comparator = "Strategy 1",
sample = "sample", strategy = "strategy", grp = "grp",
e = "e", c = "c")
names(icea_pw)
# cost-effectiveness acceptability curve
head(icea_pw$ceac[k >= 20000])
icer_tbl(icea_pw)
# }
Run the code above in your browser using DataLab