fit_dd {beezdiscounting} | R Documentation |
Fit Delay-Discounting Model
Description
This function fits a delay-discounting model to the given dataset using the specified equation and method.
Usage
fit_dd(dat, equation, method)
Arguments
dat |
A data frame containing delay ( |
equation |
A character string specifying the delay-discounting equation to use. Options include:
|
method |
A character string specifying the method for fitting the model. Options include:
|
Value
A list object of class "fit_dd"
, containing:
The fitted model(s).
The original dataset (
dat
).The specified method (
method
).
Examples
data <- data.frame(
id = rep(1:2, each = 6),
x = rep(c(1, 7, 30, 90, 180, 365), 2),
y = c(0.9, 0.5, 0.3, 0.2, 0.1, 0.05, 0.85, 0.55, 0.35, 0.15, 0.1, 0.05)
)
fit_dd(data, equation = "mazur", method = "two stage")