Package 'SSRTcalc'

Title: Easy SSRT Calculation
Description: This is a collection of functions to calculate stop-signal reaction time (SSRT). Includes functions for both "integration" and "mean" methods; both fixed and adaptive stop-signal delays are supported (see appropriate functions). Calculation is based on Verbruggen et al. (2019) <doi:10.7554/eLife.46323.001> and Verbruggen et al. (2013) <doi:10.1177/0956797612457390>.
Authors: Anton Leontyev [aut, cre]
Maintainer: Anton Leontyev <[email protected]>
License: GPL-3
Version: 0.3.4
Built: 2025-02-08 05:52:42 UTC
Source: https://github.com/agleontyev/ssrtcalc

Help Index


Adaptive-SSD dataset for stop-signal task

Description

Data from a mouse movement-based stop-signal experiment, using dynamically set stop-signal delays, with random dot kinematogram as the "go" task, collected from 63 participants

Usage

data(adaptive)

Format

A data frame with 36288 rows and 7 variables

new_id

Subject identifier

soa

stop-signal delay (ignore for "go" trials)

vol

stop (1) or go (0) trial

coh

Percent coherent dots in the kinematogram go task

RT_exp

Response time in seconds, NA if no response was made

correct

Did the participant correctly respond in "go" trials/omit response in "stop" trials (1) or not(0)?

Source

OSF archive

References

Leontyev and Yamauchi (2019) PLoS One (doi:10.1371/journal.pone.0225437)

Examples

data(adaptive)
head(adaptive)

Fixed-SSD dataset for stop-signal task

Description

Data from a mouse movement-based stop-signal experiment, using preset stop-signal delays, with random dot kinematogram as the "go" task, collected from 51 participants

Usage

data(fixed)

Format

A data frame with 29376 rows and 7 variables

new_id

Subject identifier

soa

stop-signal delay (ignore for "go" trials)

vol

stop (1) or go (0) trial

coh

Percent coherent dots in the kinematogram go task

RT_exp

Response time in seconds, NA if no response was made

response

Which button did the participant click?

acc

Did the participant respond in "go" trials/omit response in "stop" trials (1) or not(0)?

Source

OSF archive

References

Leontyev and Yamauchi (2019) PLoS One (doi:10.1371/journal.pone.0225437)

Examples

data(fixed)
head(fixed)

SSRT using integration method for studies with "adaptive" method of setting SSD

Description

Estimating SSRT using integration method for studies that use adaptive (increasing/decreasing by a given increment) stop-signal delays.

Usage

integration_adaptiveSSD(df, stop_col, rt_col, acc_col, ssd_col)

Arguments

df

Dataframe with response time, accuracy, indication whether trial is stop or go, and delays for a given trial.

stop_col

Name of the column in the dataframe df that indicates whether a given trial is a "stop" or a "go" trial ( 0 = go, 1 = stop)

rt_col

Name of the column in the dataframe df that contains response time in seconds

acc_col

Name of the column in the dataframe df that contains accuracy of inhibition ( 0 = incorrect, 1 = correct)

ssd_col

Name of the column in the dataframe df that contains stop-signal delays

Value

SSRT corresponding to the nth rt - ssd; n = p(respond|signal)*number of goRTs

Examples

data(adaptive)
sapply(split(adaptive, adaptive$new_id), integration_adaptiveSSD, stop_col = 'vol',
ssd_col = 'soa', rt_col = 'RT_exp', acc_col = 'correct')

SSRT using integration method for studies with "fixed" method of setting SSD

Description

Estimating SSRT using integration method for studies that use fixed (randomly chosen on each trial from a pre-determined set) stop-signal delays.

Usage

integration_fixedSSD(df, stop_col, rt_col, acc_col, ssd_col, ssd_list)

Arguments

df

Dataframe with response time, accuracy, indication whether trial is stop or go, and delays for a given trial.

stop_col

Name of the column in the dataframe df that indicates whether a given trial is a "stop" or a "go" trial ( 0 = go, 1 = stop)

rt_col

Name of the column in the dataframe df that contains response time in seconds

acc_col

Name of the column in the dataframe df that contains accuracy of inhibition ( 0 = incorrect, 1 = correct)

ssd_col

Name of the column in the dataframe df that contains stop-signal delays

ssd_list

List of stop-signal delays used in the experiment

Value

SSRT corresponding to the nth rt - ssd; n = p(respond|signal)*number of goRTs

Examples

data(fixed)
sapply(split(fixed, fixed$new_id), integration_fixedSSD, stop_col = 'vol',acc_col ='acc',
rt_col = 'RT_exp', ssd_col = 'soa',ssd_list = c(0.1, 0.2,0.3, 0.4, 0.5, 0.6))

SSRT using mean method for studies with "adaptive" method of setting SSD

Description

Estimating SSRT using mean method for studies that use adaptive (increasing/decreasing by a given increment) stop-signal delays

Usage

mean_adaptiveSSD(df, rt_col, ssd_col, stop_col)

Arguments

df

Dataframe with response time, accuracy, indication whether trial is stop or go, and delays for a given trial.

rt_col

Name of the column in the dataframe df that contains response time in seconds

ssd_col

Name of the column in the dataframe df that contains stop-signal delays

stop_col

Name of the column in the dataframe df that indicates whether a given trial is a "stop" or a "go" trial ( 0 = go, 1 = stop)

Value

Spline-interpolated stop-signal reaction time corresponding roughly to 50

Examples

data(adaptive)
sapply(split(adaptive, adaptive$new_id), mean_adaptiveSSD, stop_col = 'vol',
ssd_col = 'soa', rt_col = 'RT_exp')

Estimating SSRT using mean method for studies that use fixed (randomly chosen on each trial from a pre-determined set) stop-signal delays

Description

Estimating SSRT using mean method for studies that use fixed (randomly chosen on each trial from a pre-determined set) stop-signal delays

Usage

mean_fixedSSD(df, stop_col, rt_col, acc_col, ssd_col, ssd_list)

Arguments

df

Dataframe with response time, accuracy, indication whether trial is stop or go, and delays for a given trial.

stop_col

Name of the column in the dataframe df that indicates whether a given trial is a "stop" or a "go" trial ( 0 = go, 1 = stop)

rt_col

Name of the column in the dataframe df that contains response time in seconds

acc_col

Name of the column in the dataframe df that contains accuracy of inhibition ( 0 = incorrect, 1 = correct)

ssd_col

Name of the column in the dataframe df that contains stop-signal delays

ssd_list

List of stop-signal delays used in the experiment

Value

Stop-signal reaction time corresponding roughly to 50 percent inhibition accuracy.

Examples

data(fixed)
sapply(split(fixed, fixed$new_id), mean_fixedSSD, stop_col = 'vol',acc_col ='acc',
rt_col = 'RT_exp', ssd_col = 'soa',ssd_list = c(0.1, 0.2,0.3, 0.4, 0.5, 0.6))

Plots and prints stop-signal delays and accuracies

Description

Plots and prints stop-signal delays and corresponding accuracies. For studies that use fixed (randomly chosen on each trial from a pre-determined set) stop-signal delays.

Usage

plotInhFunc(df, stop_col, ssd_col, acc_col)

Arguments

df

Dataframe with response time, accuracy, indication whether trial is stop or go, and delays for a given trial.

stop_col

Name of the column in the dataframe df that indicates whether a given trial is a "stop" or a "go" trial ( 0 = go, 1 = stop)

ssd_col

Name of the column in the dataframe df that contains stop-signal delays

acc_col

Name of the column in the dataframe df that contains accuracy of inhibition ( 0 = incorrect, 1 = correct)

Value

Line plot of the inhibition function.

Examples

data(fixed)
df <- subset(fixed, new_id == 3)
plotInhFunc(df = df, stop_col='vol', ssd_col='soa', acc_col='acc')