AUC: Area Under the Curve for Discounting Data

View source: R/AUC.R

AUCR Documentation

Area Under the Curve for Discounting Data

Description

Area Under the Curve for Discounting Data

Usage

AUC(
  dat,
  indiff,
  x_axis,
  prob_disc = FALSE,
  max_x_axis = NULL,
  amount,
  groupings = NULL,
  imp_zero = TRUE,
  type = "linear",
  log_base = 2
)

Arguments

dat

Discounting data tibble

indiff

Indifference points Variable in dat

x_axis

Delays/probabilities/social distance variable in dat

prob_disc

Boolean for whether data are probability discounting

max_x_axis

Numeric; Maximum possible value in x_axis. If left NULL, the function will determine and use the maximum value in the x_axis variable. Useful for comparing AUC across non-standard data sets where the maximum x_axis value is not shared.

amount

Numeric; Maximum amount of indifference points. (A in discounting models.)

groupings

Variables for grouping (e.g., subject, experimental group) as a character or vector of characters

imp_zero

Boolean for whether indifference points at x_axis = 0 (e.g., delay = 0, odds against = 0, etc.) should be added to the data.

type

String for the type of AUC that should be calculated. Acceptable values are one of c("linear","log","ordinal")

log_base

If using logarithmic, what is the base of the log

Value

Tibble or with AUC by all grouping factors. If no grouping factor specified then a tibble with one AUC will be returned.

Examples

AUC(examp_DD,
  indiff = "prop_indiff",
  x_axis = "delay_months",
  amount = 1,
  type = "linear",
  prob_disc = FALSE,
  groupings = c("subject", "outcome")
)

discAUC documentation built on March 31, 2023, 5:26 p.m.