Learn R Programming

SSRTcalc (version 2.1.1)

ssrt_simulate: Parametric Monte Carlo SSRT estimation via ex-Gaussian simulation

Description

Fits an ex-Gaussian to observed go-RT data, simulates synthetic datasets under the horse-race model, and estimates SSRT on each.

Usage

ssrt_simulate(
  data,
  n_iter = 2000,
  n_trials = NULL,
  p_stop = NULL,
  ssrt_true = NULL,
  conf = 0.95,
  stop_col = "vol",
  rt_col = "RT_exp",
  acc_col = "correct",
  ssd_col = "soa",
  seed = 42
)

Value

Object of class ssrt_simulate.

Arguments

data

data.frame in SSRTcalc long format.

n_iter

MC iterations. Default 2000.

n_trials

Trials per simulated dataset. NULL uses nrow(data).

p_stop

Stop-trial proportion. NULL uses observed proportion.

ssrt_true

Known true SSRT for parameter recovery. Default NULL.

conf

Confidence level. Default 0.95.

stop_col, rt_col, acc_col, ssd_col

Column names.

seed

Random seed. Default 42.

Examples

Run this code
data(adaptive)
d <- adaptive[adaptive$SubjID == 1, ]
s <- ssrt_simulate(d, n_iter=500)
print(s)

Run the code above in your browser using DataLab