Generate data used to plot a linear partial value function for a particular criteria given model outcomes.

lpvf_plot_data(x, criteria_min = NULL, criteria_max = NULL,
  optimal = c("low", "high"), length_out = 1000)

Arguments

x

Model outcomes for a particular criteria on the original scale.

criteria_min

A vector of minimum values for each criterion. If NULL, then the minimum value is computed automatically.

criteria_max

A vector of maximum values for each criterion. If NULL, then the maximum value is computed automatically.

optimal

If "low", then lower values of the outcome are better, and, if "high", then higher values of the outcome are better.

length_out

Number of points between minimum and maximum values of x.

Value

A data.table containing x and y coordinates for a line plot.

See also

Examples

outcome <- rnorm(10, mean = 100, sd = 11) # Using optimal plot_data <- lpvf_plot_data(outcome, optimal = "high") print(plot_data)
#> x y #> 1: 83.84492 0.0000000 #> 2: 83.88159 0.1001001 #> 3: 83.91825 0.2002002 #> 4: 83.95492 0.3003003 #> 5: 83.99158 0.4004004 #> --- #> 996: 120.32584 99.5995996 #> 997: 120.36250 99.6996997 #> 998: 120.39917 99.7997998 #> 999: 120.43583 99.8998999 #> 1000: 120.47249 100.0000000
# Using criteria_min and criteria_max plot_data <- lpvf_plot_data(outcome, criteria_min = 80, criteria_max = 130) print(plot_data)
#> x y #> 1: 80.00000 0.0000000 #> 2: 80.05005 0.1001001 #> 3: 80.10010 0.2002002 #> 4: 80.15015 0.3003003 #> 5: 80.20020 0.4004004 #> --- #> 996: 129.79980 99.5995996 #> 997: 129.84985 99.6996997 #> 998: 129.89990 99.7997998 #> 999: 129.94995 99.8998999 #> 1000: 130.00000 100.0000000