Stop signal task - pre error speeding
조회 수: 3 (최근 30일)
이전 댓글 표시
I am working with a choice stop signal task, and need help extracting the RT before an erronous stop trial in order to investigate pre-error speeding.
This is how I extracted the goRT
for y = 1:size(eegdata.data,3)
idx = contains (eegdata.epoch(y).eventtype,'leftGoResponse') | contains(eegdata.epoch(y).eventtype,'rightGoResponse');
if (sum(idx)>0)
RT(y) = eegdata.epoch(y).eventlatency{idx};
else
RT(y)= nan;
end
end
goRT(s) = mean(RT,'omitnan')
The "names" for errounous stop trial is 'stopGoRightFA' and 'stopGoLeftFA'
So I need to extract the goRT before an errounous stop trial, and only that.
댓글 수: 2
Jeff Miller
2021년 4월 30일
Is idx a single boolean just for trial y, or is it a vector? I would have thought it was just a single boolean, but sum(idx) would be unnecessary in that case, so I am confused.
채택된 답변
Jeff Miller
2021년 5월 2일
I think it would be cleanest to start by making a vector to indicate which trials precede unsuccessful stops, which can be done like this (if I have understood everything):
ntrials = size(eegdata.data,3);
PrecedeErrStop = false(ntrials,1);
for y=1:ntrials-1 % the last trial is not followed by anything
PrecedeErrStop(y) = (contains(eegdata.epoch(y).eventtype,'leftGoResponse') | contains(eegdata.epoch(y).eventtype,'rightGoResponse')) ...
& (contains(eegdata.epoch(y+1).eventtype,'stopGoRightFA') | contains(eegdata.epoch(y+1).eventtype,'stopGoLeftFA'));
end
%PrecedeErrStop is now a vector 1:ntrials where true indicates that the
%trial does precede a stop error and false indicates that it does not.
Then you can select out the RTs that do and do not precede stop errors like this:
PrecedeErrStopRTs = eegdata.epoch(PrecedeErrStop).eventlatency{1};
NotPrecedeErrStopRTs = eegdata.epoch(~PrecedeErrStop).eventlatency{1};
The PrecedeErrStop vector will also be useful if you want to compute ERPs for the error stop trials or to exclude the error stop trials from computation of regular ERPs.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!