PlotUtilityDiff: Plot utility difference

View source: R/plot_utility.R

PlotUtilityDiffR Documentation

Plot utility difference

Description

See Figure 7 for example.

Usage

PlotUtilityDiff(res, idx = NULL)

Arguments

res

The data frame generated from CalUtilityDiff.

idx

The row index of observations to be included. The default is all the observations from the data.

Value

A ggplot.

Examples


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
PlotUtilityDiff(sample_utility)



aihuman documentation built on April 12, 2025, 1:47 a.m.