Install
openclaw skills install @guigui855/rt-attention-analysisProcesses reaction-time (RT) and accuracy data from continuous-performance / sustained-attention tasks (PVT, SART, gradCPT). Computes trailing-average RT windows, cumulative mean and standard deviation, real-time fast/slow triggering thresholds (μ±σ), lapse detection, RT variability, and bootstrap /
openclaw skills install @guigui855/rt-attention-analysisAnalyze reaction-time (RT) data from continuous performance tasks (CPTs) such as the PVT, SART, or gradCPT. Implements the real-time "fast/slow triggering" procedure from deBettencourt et al. (2019) and the lapse-prediction analyses from Shelat et al. (2024).
One row per trial. Minimum column: rt (response time in ms). Optional columns:
trial, acc (1/0 or correct/incorrect), freq (frequent=1, infrequent=0),
block, condition.
For each trial i:
mu, sigma = cumulative mean and standard deviation of all RTs up to trial
i (initialize on the first ~80 trials).trailing = mean of the last 3 RTs (i-2, i-1, i).trailing < mu - sigma → fast state (low attention) → trigger a probe.trailing > mu + sigma → slow state (high attention) → trigger a probe.i+1 and require the three
preceding trials to be frequent and correct.Faster trailing RTs predict worse attention; slower RTs predict better attention.
scripts/rt_trigger.py — pure-stdlib implementation of the triggering
algorithm; writes per-trial state and fast/slow probe labels to CSV.
No third-party dependencies.scripts/rt_analyze.py — full pipeline: load, clean, lapse detection, RT
variability, Cohen's d, Spearman r, bootstrap CI, and an RT time-series plot
(matplotlib optional).Run:
python scripts/rt_trigger.py data.csv --out triggered.csv
python scripts/rt_analyze.py data.csv --out report/
See references/methods.md for the methodological background and formulas.