Estimating Stop Signal Reaction Times and Stop Signal Delay

Helper functions for estimating the SSRT (stop signal reaction time) in a Stop-Signal Task based on Verbruggen et al. (2019) and a mid-run estimates method for computing the mean SSD (stop signal delay) based on Levitt (1971) .


sstFun

Estimate the stop-signal reaction time (SSRT) from stop-signal task data, following the recommendations of the consensus guide (Verbruggen et al., 2019).

sstFun provides three SSRT estimators and the mid-run estimate of the stop-signal delay (SSD) for staircase (tracking) designs. It validates its input, warns about non-conventional combinations of methods, and ships a simulated data set with known latent variables for testing and teaching.

Installation

# development version (2.0.0, work in progress)
pak::pak("sonntasa/sstFun")

# CRAN release (1.0.0)
install.packages("sstFun")

Upgrading from 1.0.0? Version 2.0.0 renames arguments and output columns and changes some defaults, so estimates can differ from earlier versions. See NEWS.md for a migration guide.

Methods

SSRT is estimated as a go RT minus an SSD estimate:

Function Go RT SSD Notes
meanSSRT() mean go RT mean SSD Only appropriate when p(respond | signal) is close to .5
intSSRT() nth go RT, where n = p(respond | signal) × number of go RTs mean SSD Integration method; recommended by the consensus guide
medSSRT() median go RT mid-run SSD
mid_run_avg() – mid-run SSD estimate Used by the estimators; can be called directly

Integration method. intSSRT() estimates the SSRT from the go RT distribution and the probability of responding on stop trials. At p(respond | signal) = .5 the nth RT is the median go RT, so the result agrees with the mean method only if the go RT distribution is symmetric. With skewed RTs the two differ.

SSD estimation. The SSD can be the mean of all SSDs or, more suited to staircase paradigms, the mid-run estimate: the average of the midpoints of every second run between reversals of the staircase (see Levitt, 1971; Wetherill & Levitt, 1965). mid_run_avg() assumes one continuous staircase per participant and rows in trial order.

Slow and missing go RTs. By default (replace_slow = TRUE), go omissions and go RTs slower than rt_max (default 600 ms) are replaced by the participant's slowest valid go RT, as recommended in the consensus guide. Turning this off is possible, but discouraged for the integration and median methods, and the package warns.

Data format

One row per trial, in trial order within each participant. The defaults expect these columns; other names can be passed unquoted (see below).

Column Content
id participant identifier
trial_type "go" or "stop"
ssd stop-signal delay in ms; NA on go trials
rt reaction time in ms; NA if there was no response
corr logical. Go trials: TRUE if the participant responded (FALSE is an omission). Stop trials: TRUE if the response was inhibited, so FALSE means the participant responded

Usage

The package includes sst_example, simulated data from 12 participants (true mean SSRT = 220 ms).

library(sstFun)

meanSSRT(sst_example)
intSSRT(sst_example)
medSSRT(sst_example)
mid_run_avg(sst_example)

Each function returns one row per participant. Use return_full = TRUE to see the components of the estimate:

intSSRT(sst_example, return_full = TRUE)

Screen participants whose p(respond | signal) is far from .5. The consensus guide recommends excluding them (e.g. below 25 % or above 75 %), and p_resp is returned as a percentage:

subset(intSSRT(sst_example, return_full = TRUE), p_resp < 25 | p_resp > 75)

Other column names and trial labels

intSSRT(
  my_data,
  participant = pid, trial_type = cond, corr = acc, ssd = delay, rt = rt_ms,
  trial_labels = c(stop = "Stop", go = "Go")
)

trial_labels is a named character vector with elements go and stop.

Useful options

Argument Effect
rt_max go RTs slower than this value (ms) count as slow
replace_slow replace slow and missing go RTs (default TRUE)
mid_run use the mid-run SSD estimate (default: the conventional choice for each method)
err_exc meanSSRT() only: exclude incorrect go trials
return_full return all components of the estimate
every_second mid_run_avg(): use every second run (default) or all runs

The package warns when a method is combined with an SSD estimate it is not conventionally used with, or when slow-trial replacement is switched off. These combinations are provided for methodological comparison.

Example data

sst_example also includes the simulated latent variables go_rt and ssrt_true, which are not observable in real data but allow the accuracy of the estimators to be checked, per participant and per trial. go_rt is not an observed RT; always pass rt to the estimators.

# compare estimates with each participant's realised mean stop latency
truth <- aggregate(
  ssrt_true ~ id,
  data = subset(sst_example, trial_type == "stop"),
  FUN = mean
)
merge(intSSRT(sst_example), truth, by = "id")

See ?sst_example for details.

Citation

If you use this package, please cite it (citation("sstFun")) and the consensus guide.

References

Levitt, H. (1971). Transformed up-down methods in psychoacoustics. The Journal of the Acoustical Society of America, 49(2B), 467–477.

Verbruggen, F., Aron, A. R., Band, G. P., Beste, C., Bissett, P. G., Brockett, A. T., ... Boehler, C. N. (2019). A consensus guide to capturing the ability to inhibit actions and impulsive behaviors in the stop-signal task. eLife, 8, e46323.

Wetherill, G. B., & Levitt, H. (1965). Sequential estimation of points on a psychometric function. British Journal of Mathematical and Statistical Psychology, 18(1), 1–10.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("sstFun")

2.0.0 by Samuel Sonntag, 12 hours ago


https://github.com/sonntasa/sstFun


Report a bug at https://github.com/sonntasa/sstFun/issues


Browse source code at https://github.com/cran/sstFun


Authors: Samuel Sonntag [cre, aut] (ORCID: , Carolin Dudschig [aut] , Ian G Mackenzie [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cli, dplyr, utils, rlang, stats

Suggests testthat


See at CRAN