Learn R Programming

predictNMB (version 0.2.1)

summary.predictNMBscreen: Create table summaries of predictNMBscreen objects.

Description

Create table summaries of predictNMBscreen objects.

Usage

# S3 method for predictNMBscreen
summary(
  object,
  what = c("nmb", "inb", "cutpoints"),
  inb_ref_col = NULL,
  agg_functions = list(median = function(x) {
     round(stats::median(x), digits = 2)

}, `95% CI` = function(x) { paste0(round(stats::quantile(x, probs = c(0.025, 0.975)), digits = 1), collapse = " to ") }), rename_vector, show_full_inputs = FALSE, ... )

Value

Returns a tibble.

Arguments

object

A predictNMBscreen object.

what

What to summarise: one of "nmb", "inb" or "cutpoints". Defaults to "nmb".

inb_ref_col

Which cutpoint method to use as the reference strategy when calculating the incremental net monetary benefit. See do_nmb_sim for more information.

agg_functions

A named list of functions to use to aggregate the selected values. Defaults to the median and 95% interval.

rename_vector

A named vector for renaming the methods in the summary. The values of the vector are the default names and the names given are the desired names in the output.

show_full_inputs

A logical. Whether or not to include the inputs used for simulation alongside aggregations.

...

Additional, ignored arguments.

Details

Table summaries will be based on the what argument. Using "nmb" returns the simulated values for NMB, with no reference group; "inb" returns the difference between simulated values for NMB and a set strategy defined by inb_ref_col; "cutpoints" returns the cutpoints selected (0, 1).

Examples

Run this code

# perform screen with increasing values of model discimination (sim_auc)
# \donttest{
get_nmb <- function() c("TP" = -3, "TN" = 0, "FP" = -1, "FN" = -4)
sim_screen_obj <- screen_simulation_inputs(
  n_sims = 50, n_valid = 10000, sim_auc = seq(0.7, 0.9, 0.1),
  event_rate = 0.1, fx_nmb_training = get_nmb, fx_nmb_evaluation = get_nmb,
  cutpoint_methods = c("all", "none", "youden", "value_optimising")
)
summary(
  sim_screen_obj,
  rename_vector = c(
    "Value_Optimising" = "value_optimising",
    "Treat_None" = "none",
    "Treat_All" = "all",
    "Youden_Index" = "youden"
  )
)
# }

Run the code above in your browser using DataLab