| cswald | R Documentation |
Censored-Shifted Wald Model
cswald(rt, response, links = NULL, version = c("simple", "crisk"), ...)
rt |
The name of the variable in the dataset containing the response times. Response times should be coded in seconds (not milliseconds). |
response |
The name of the variable in the dataset containing the response/decision. Responses should be coded as 0 (lower boundary) or 1 (upper boundary). Alternatively, character values "lower" and "upper" or logical values (FALSE/TRUE) are accepted and will be converted automatically. |
links |
A named list of link functions for the model parameters.
Available parameters depend on the version: "simple" has |
version |
A character string specifying which version of the cswald model to use. Options are:
For more details, see Miller et al. (2017). |
... |
Additional arguments passed internally (for testing purposes). |
Domain: Decision Making / Response times
Task: Choice Reaction Time tasks (with few errors)
Name: Censored-Shifted Wald Model
Citation:
Miller, R., Scherbaum, S., Heck, D. W., Goschke, T., & Enge, S. (2017). On the Relation Between the (Censored) Shifted Wald and the Wiener Distribution as Measurement Models for Choice Response Times. Applied Psychological Measurement, 42(2), 116-135. https://doi.org/10.1177/0146621617710465
Version: simple
Requirements:
Reaction times should be passed in seconds
The response variable should be passed numerically: 0 = lower response, 1 = upper response
Parameters:
drift: drift rate
bound: boundary (distance from starting point to correct boundary)
ndt: non-decision time
s: diffusion constant
Fixed parameters:
mu = 0
s = 0
Default parameter links:
drift = log; bound = log; ndt = log; s = log
Default priors:
drift:
main: normal(0,1)
effects: normal(0,0.3)
bound:
main: normal(0,0.3)
effects: normal(0,0.3)
ndt:
main: normal(-2,0.3)
effects: normal(0,0.3)
s:
main: normal(0,0.3)
effects: normal(0,0.2)
An object of class bmmodel
dcswald() and rcswald() for the density and random generation
functions.
# generate simulated data from the diffusion model
dat <- rcswald(n = 500, drift = 2, bound = 1.5, ndt = 0.3, zr = 0.5, s = 1)
# specify the model
model <- cswald(rt = "rt", response = "response", version = "simple")
# specify the formula
formula <- bmf(
drift ~ 1,
bound ~ 1,
ndt ~ 1
)
# fit the model
fit <- bmm(
formula = formula,
data = dat,
model = model,
cores = 4,
backend = "cmdstanr"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.