Skip to contents

Simulate response time data with specific parameters following a diffusion model. The data are generated using rdiffusion(), so that check its documentation.

Usage

ddm_data(
  n = 100,
  drift = 0,
  bs = 1,
  bias = 0.5,
  ndt = 0.2,
  ndt_var = 0.1,
  include_parameters = FALSE,
  ...
)

Arguments

n

Number of observations.

drift

Drift parameter. Typical range: [-5, 5].

bs

boundary separation parameter. Typical range: [0.5, 2].

bias

Bias parameter. Default to 0.5*bs.

ndt

Non-decision time parameter. Typical range: [0.1, 0.5] s.

ndt_var

Variability of non-decision time. Typical range: [0, 0.2] s.

include_parameters

Whether to add the parameters to the data.

...

Other arguments to pass to other functions, such as additional controls to ddm_traces().

Examples

df <- ddm_data(n = c(100, 100), drift = c(1, 0))
summary(df$data)
#>        rt          response   condition
#>  Min.   :0.2433   lower: 79   1:100    
#>  1st Qu.:0.3399   upper:121   2:100    
#>  Median :0.4211                        
#>  Mean   :0.4724                        
#>  3rd Qu.:0.5789                        
#>  Max.   :1.2933