Description
Linear and Non-Linear AUC for Discounting Data.
Description
Area under the curve (AUC; Myerson et al., 2001) <doi:10.1901/jeab.2001.76-235> is a popular measure used in discounting research. Although the calculation of AUC is standardized, there are differences in AUC based on some assumptions. For example, Myerson et al. (2001) <doi:10.1901/jeab.2001.76-235> assumed that (with delay discounting data) a researcher would impute an indifference point at zero delay equal to the value of the larger, later outcome. However, this practice is not clearly followed. This imputed zero-delay indifference point plays an important role in log and ordinal versions of AUC. Ordinal and log versions of AUC are described by Borges et al. (2016)<doi:10.1002/jeab.219>. The package can calculate all three versions of AUC [and includes a new version: IHS(AUC)], impute indifference points when x = 0, calculate ordinal AUC in the case of Halton sampling of x-values, and account for probability discounting AUC.
README.md
discAUC
The goal of discAUC is to provide a solution to easily calculate AUC for delay discounting data. It includes logAUC and ordAUC as published in Borges et al. (2016). It also includes a solution for 0 delays for logAUC.
Installation
You can install the released version of discAUC from CRAN with:
install.packages("discAUC")
This is a basic example which shows you how to solve a common problem:
library(discAUC)
#Calculate AUC for proportional indiference points for each outcome per subject.
AUC(dat = examp_DD,
x_axis = "delay_months",
indiff = "prop_indiff",
amount = 1,
groupings = c("subject","outcome"))
#> # A tibble: 60 × 3
#> # Groups: subject [15]
#> subject outcome AUC
#> <dbl> <chr> <dbl>
#> 1 -988. $100 Gain 0.359
#> 2 -988. alcohol 0.0953
#> 3 -988. entertainment 0.405
#> 4 -988. food 0.158
#> 5 -2 $100 Gain 0.000278
#> 6 -2 alcohol 0.000278
#> 7 -2 entertainment 0.000278
#> 8 -2 food 0.000278
#> 9 -1 $100 Gain 1
#> 10 -1 alcohol 1
#> # … with 50 more rows