-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBCIsystem_errorRate.m
55 lines (42 loc) · 1.73 KB
/
BCIsystem_errorRate.m
1
2
3
4
5
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
52
53
54
55
%% ================= BCI system error rate =================
% Export file to perform a mixed-ANOVA using spss to evaluate the impact of
% group (non-autistic and autistic), practice/learning stage (initial,
% intermediate 1 and 2, and final), and respective interaction on BCI error
% rate.
clear all
clc
%%
file = readtable('C:\toolbox\Code_Speller_Reverse\results\behavioral_results.xlsx');
age_sex = readtable('C:\toolbox\Code_Speller_Reverse\data\age_sex.xlsx');
%%
ii=1;
for group=["S","P"]
for sub=1:10
spss_file{ii,1} = group;
for stage = 1:4
if stage == 1
trials=[2:6];
elseif stage == 2
trials=[7:11];
elseif stage == 3
trials=[12:16];
else
trials = [17:21];
end
idx = find(file.Participant==sub & file.Group==group & ismember(file.Trial,trials));
spss_file{ii,1+stage} = mean(file.Syst_err(idx)./file.Total_letters(idx));
end
if group=="S"
spss_file{ii,6} = age_sex.Age(find(age_sex.Participant_id==sub));
spss_file{ii,7} = age_sex.Sex(find(age_sex.Participant_id==sub));
else
spss_file{ii,6} = age_sex.Age(find(age_sex.Participant_id==sub+10));
spss_file{ii,7} = age_sex.Sex(find(age_sex.Participant_id==sub+10));
end
ii=ii+1;
end
end
%%
spss_file = array2table(spss_file, 'VariableNames',{'Group','Syst_1','Syst_2','Syst_3','Syst_4','Age','Sex'});
writetable(spss_file, ...
'C:\toolbox\Code_Speller_Reverse\results\BCI_errorRate.xlsx');