prep_log_AUC {discAUC} | R Documentation |
Calculate log x_axis values for AUClog
Description
Calculate log x_axis values for AUClog
Usage
prep_log_AUC(
dat,
x_axis,
log_base = 2,
type = "adjust",
correction = 1,
dec_offset = TRUE
)
Arguments
dat |
Discounting data tibble. |
x_axis |
Delays/probabilities/social distance variable |
log_base |
Base of the logarithm |
type |
Type of correction to handle 0 values on x_axis. Acceptable values are "corr"., "adjust", and "IHS". "Corr" adds a set value to each x_axis value and then takes the log of those values. "Adjust" implements increasing the x_axis values by the average difference between the log values on the x_axis. "IHS" calculates the inverse hyperbolic sine, which is different than the logarithm but is highly correlated with log transformed values. The IHS transformation does not require corrections |
correction |
If |
dec_offset |
If |
Value
Original data frame (a tibble) that includes an appended column with log scale version of x_axis
Correction types for handling zero x-axis values
"Corr" adds a set correction value to each x_axis
value and then takes the log of those values. "Adjust" implements increasing
the x_axis
values by the average difference between the log values on the x_axis
.
"IHS" calculates the inverse hyperbolic sine for the x_axis
,
which is different than the logarithm
but is highly correlated with log transformed values. The IHS transformation
does not require adjustments because IHS(0) == 0
.
Examples
prep_log_AUC(
dat = examp_DD,
x_axis = "delay_months",
log_base = 10,
dec_offset = TRUE,
type = "adjust",
correction = 1
)