Activity: Go/No-Go#
Documentation for tasks.go_no_go.py, part of the Tasks utilities in the M2C2 DataKit package.
Module Summary#
This module contains functions to score and summarize the Go/No-Go task data. The Letter Go/No-Go is a continuous performance task where participants are asked to press a button at the bottom of the screen every time a letter appears in the center of the screen. The Go/No-Go task measures attention and inhibitory control by requiring participants to respond to "GO" stimuli, while withholding responses to "NOGO" stimuli.

Citations#
[INSERT CITATIONS HERE]
Public API#
go_no_go
#
score_errors(row)
#
Identifies and returns the type of error in a Go/No-Go task trial.
The function classifies the trial based on the correctness and the type of response provided. It returns "omission" for a missed response to a "GO" trial and "commission" for an incorrect response to a "NOGO" trial. "correct" is returned if the response is correct.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
row
|
Series
|
A single row of the trial-level Go/No-Go task dataframe containing the columns "trial_type", "trial_response", and "correct". |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str | None
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the trial type or response values are invalid. |
Source code in m2c2_datakit/tasks/go_no_go.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
summarize(x, trials_expected=30, rt_outlier_low=100)
#
Summarizes the Go/No-Go task data by calculating statistics such as omission errors, commission errors, correct responses, and response times.
This function computes the number of omission errors, commission errors, correct responses, and overall response times for the Go/No-Go task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
DataFrame
|
The trial-level scored dataset for the Go/No-Go task. |
required |
trials_expected
|
int
|
The expected number of trials. Defaults to 30. |
30
|
Returns:
| Type | Description |
|---|---|
Series
|
A Pandas Series containing the summary statistics for the Go/No-Go task. |
Source code in m2c2_datakit/tasks/go_no_go.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |