Offline statistical analysis in MATLAB:

 CSV data for n CONDITIONS for all subjects need to be in one folder and the files for each subject should be renamed with prefix '1-', such as 1-FCM.csv ...1-VST.csv, 1_AVA.csv etc.

Create 2 m files 

 Download  Matlab Script (mScript.pdf)

 

 Matlab Scripts

rls=44;% number of rules

 % CSV data for n CONDITIONS for all subjects need to be in one folder

% Files for each subject should be renamed with prefix '1-', such as 1-AVSN ...2-AVSN

[X,numFile]=DataConverterCSV(rls);

 

% save DataConverterCSV  function in a separate .m file

function [X,numFile]=DataConverterCSV(rls)

dName = uigetdir; %% select the directory of the data

fPath=strcat(dName,'\');

fList=dir(fullfile(strcat(dName,'\','*.csv')));

numFile=numel(fList);

for nn=1:numFile

    fName=fList(nn).name;

    pfName=strcat(fPath,fName);

    X{nn} = csvread(pfName);

end 

%end DataConverterCSV

 

DATA1= zeros(1, rls);% CODITION AVA - audio-visual attention

DATA2= zeros(1, rls); % CODITION FCMs - Cognitive Maps  

DATA3= zeros(1, rls); % CODITION VST- Visuospatial Traversing

 

 

for nn=1:3:numFile

    DATA1p=X{nn}; DATA1=[DATA1;DATA1p(:,3:rls+2)];

    DATA2p=X{nn+1}; DATA2=[DATA2;DATA2p(:,3:rls+2)];

    DATA3p=X{nn+2}; DATA3=[DATA3;DATA3p(:,3:rls+2)];

end

 

% MAKING GROUPS  - Create Cell Array of Character Vectors for any kind of groups, e.g

g1 = {'Theta', 'Alpha',..., 'Gamma'}; % bands

g2 = {'Prefrontal', 'Frontal','Temp' ,..., 'Occip'}; % sites , electrode positions

g3 = {'Left', 'Right','No' ,}; % lateralization

g4 = {'T7-A', 'AF-T','P8-T' ,..., 'O2-A'}; % Fuzzy rules

 

 

%%%%%%%%%post-hoc multiple comparison with type of critical value  'bonferroni' that rejects the null-hypothesis at the 1% significance level

%%%%%%%%%'CType' — Type of critical value  'bonferroni'  change the hypothesis tests at the 1% significance level compared to the default Tukey's honest significant difference criterion

[p,t,statsG1] = anova1(DATA1,g1,'on');

[c,m,h,nms] = multcompare(statsG1,'Alpha',0.01,'CType','bonferroni');

...

[pG4,tG4,statsG4] = anova1(DATA1,g4,'on');

[cG4,mG4,hG4,nmsG4] = multcompare(statsG4,'Alpha',0.01,'CType','bonferroni');

 

%%%%%%%%%%%%%Post-hoc pairwise sample t-test

[h4, p4] = ttest2(DATA1(:,29), DATA1(:,30)); % AVA AF3-T (R29), AF4-T(R30)

[h5, p5] = ttest2(DATA2(:,29), DATA2(:,30)); % AVSP  AF3-T , AF4-T

[h6, p6] = ttest2(DATA1(:,30), DATA2(:,30));  % AVA vs AVSP  AF4-T

 

%%%%%%%%%%%%% MULTICOMPARE DATA vs groups

[h1, p1] = ttest2(DATA1, DATA2);

[h2, p2] = ttest2(DATA1, DATA3);

 

[h3, p3] = ttest2(DATA2, DATA3);