Learn R Programming

aihuman (version 1.0.0)

PlotUtilityDiffCI: Plot utility difference with 95% confidence interval

Description

See Figure S17 for example.

Usage

PlotUtilityDiffCI(res)

Value

A ggplot.

Arguments

res

The second data frame (res.mcmc) generated from CalUtilityDiff(include.utility.diff.mcmc = TRUE).

Examples

Run this code
# \donttest{
data(synth)
sample_mcmc <- AiEvalmcmc(data = synth, n.mcmc = 10)
synth_dmf <- sample(0:1, nrow(synth), replace = TRUE) # random dmf recommendation
sample_utility <- CalOptimalDecision(
  data = synth, mcmc.re = sample_mcmc,
  c0.ls = seq(0, 5, 1), c1.ls = seq(0, 5, 1),
  dmf = synth_dmf, size = 1, # adjust the size
  include.utility.diff.mcmc = TRUE
)
PlotUtilityDiffCI(sample_utility$res.mcmc)
# }

Run the code above in your browser using DataLab