Browse Source

gin commit from Fionas-MacBook-Pro.local

New files: 13
fiona 3 years ago
parent
commit
a7213c5ed3
13 changed files with 487 additions and 0 deletions
  1. BIN
      Exp1_AllData.mat
  2. BIN
      Exp2_AllData.mat
  3. BIN
      Exp3_AllData.mat
  4. 19 0
      README1.md
  5. 41 0
      ReadME.txt
  6. 64 0
      calError.m
  7. 27 0
      dataProcessAll_Exp1.m
  8. 26 0
      dataProcessAll_Exp2.m
  9. 51 0
      dataProcessAll_Exp3.m
  10. 41 0
      dataProcessValid_Exp1.m
  11. 59 0
      dataProcessValid_Exp2.m
  12. 125 0
      dataProcessValid_Exp3.m
  13. 34 0
      procRec.m

BIN
Exp1_AllData.mat


BIN
Exp2_AllData.mat


BIN
Exp3_AllData.mat


+ 19 - 0
README1.md

@@ -0,0 +1,19 @@
+# Contextual Cueing in Collaborative Visual Search
+
+Xuelian Zang1,2 Artyom Zinchenko3, Jiao Wu1, Xiuna Zhu3, Fangfang4 & Zhuanghua Shi3
+1. Institutes of Psychological Sciences, College of Education, Hangzhou Normal University, 311121, China
+2. Center for Cognition and Brain Disorders, Affiliated Hospital of Hangzhou Normal University, 310015, China.
+3. Department Psychologie, Ludwig-Maximilians-Universität München, Munich, Germany
+4. School of Psychological and Cognitive Sciences and Beijing Key Laboratory of Behavior and Mental Health, Peking University, Beijing, 100871, China
+
+*. 	Note Xuelian Zang and Artyom Zinchenko contributed equally to this manuscript.
+
+## Abstract
+
+Repeatedly presenting a target within a stable search array facilitates visual search, an effect termed “contextual cueing”. Previous solo-performance studies have shown that contextual learning requires explicit allocation of attentional resources to the task-relevant repeated context, while repeated, but task-irrelevant subsets of items show no contextual benefits. Lack of attention to repeated, but task-irrelevant contexts may weaken contextual cueing. In a co-active  environment, however, people often share some attention to both self-relevant and co-actor relevant context. Whether participants can acquire  co-actor relevant, but self-irrelevant repeated contexts remains unsolved. Thus, the present study adopted the contextual cueing paradigm under the co-active social context. Participants learned a cued subset of the search display (either black or white) in the learning phase, and tested the search performance for the irrelevant subsets in the transfer phase. The experiment was conducted either in a solo condition (Experiments 1 and 3) or in a joint-action condition(Experiment 2). Contextual cueing was observed in all three experiments in the training phase. However, contextual learning of the irrelevant context in the transfer session was only manifested in the joint-action Experiment 2. Our findings suggest that shared focus of attention between partners enables representations of a coactor's task prompting contextual learning of otherwise irrelevant context. We conclude that the social interaction may widen the scope of attention, thus facilitating the acquisition of task-irrelevant contexts.
+
+
+## Data and code
+
+* data: Exp1_AllData.mat,  Exp2_AllData.mat, Exp3_AllData.mat
+* Analysis codes:  dataProcessAll_Exp1.m,  dataProcessAll_Exp2.m,  dataProcessAll_Exp3.m

+ 41 - 0
ReadME.txt

@@ -0,0 +1,41 @@
+%% Author: Xuelian Zang
+%% Contact: zangxuelian@gmail.com, lianlian81821@126.com
+%% Date:09th Sep, 2020
+%% Descriptions: All the experimental data and the related code for processing data are provided.
+
+
+Exp1_AllData.mat: Dataset for Experiment 1 (solo-search condition)
+Exp2_AllData: Dataset  for Experiment 2 (joint action condition)
+Exp3_AllData.mat: Dataset for Experiment 3 (solo-search condition)
+
+
+Note: the data are already preprocessed by combining different participants response together. 
+Error trials and invalid trials (RTs of below 200 ms and above 2.5 standard deviations from the mean) 
+are separately saved.
+
+
+For each data set, it includes data for three sessions, namely 'train','test' and 'rec' for the training, test 
+and recognition sessions respectively.
+
+Data for each session consist of 'valid','err' and 'dis' for valid trials, error trials, and discarded outliers. When 
+put these three parts together, we obtain all the responses for all experimental trials.
+
+
+For each subset data, take AllData.train.valid as an example:
+RP:	 participants' actual key press, corresponding to the four response keys. 1=key 1!, 2= key 2@, 3=key 8*, 4= key 0)
+RT: 	 participants' response time in seconds
+Crr:	 correct trials. >0 1=left response correct; 2= right response correct; -3 = left response wrong; -2=right response wrong
+NT:	 number of trials
+NB:	 number of blocks
+White:	 left target white? 1 = white, 0 = black
+New1:  current configuration  related to  left target new? 1= new, 0 = old
+TLoc1:  left target's location
+OriBlack: right target black? 1= black, 0 =white
+New2:   current configuration related to the right target new? 1= new, 0 = old, this column is the same as New1
+TLoc2: 	left target's location
+Dir1: 	left target's orientation, 1= left, 2=right
+Dir2:   right target's orientation, 1= left, 2=right
+NE:    	number of epochs
+NSub: 	number of subjects
+
+For all the variable named with 'for Spss', you could copy its data to SPSS and directly use SPSS to run statistical test.

+ 64 - 0
calError.m

@@ -0,0 +1,64 @@
+%% calError.m
+%% Description: calculate the error rates, discard rates the ANOVA of error array
+%% Date: 04/12/2014
+%% Contact: zangxuelian@gmail.com
+function dataOut = calError(dataIn, Exp)
+
+    %% calculate discard rate array       
+%         %% Array: o1e1  o1e2  o1e3  o1e4   o1e5   o1e6   o2e1   o2e2  o2e3
+%         %% o2e4  o2e5  o2e6
+%         %% disArray.p1...
+    numOfEP = Exp.nEp + Exp.nEpT;
+    dataTemp = [dataIn.train.err;  dataIn.test.err; dataIn.train.dis;  dataIn.test.dis];
+    errArray = zeros(Exp.subNum, 2*(Exp.nEp + Exp.nEpT ));
+    for j = 1 : Exp.subNum % for each subject
+            for t = 0:1 % for old and new
+                for m = 1:(numOfEP) % for EP 1:6
+                    temp = dataTemp(dataTemp.NSub == j & dataTemp.New1 == t & dataTemp.NE == m,:);
+                        if ~isempty(temp)
+                             numOfAllTrial = Exp.nTrl * Exp.numOfBlock.TrainEpoch/2 ;
+                             errArray(j, t*numOfEP+m) = 100*length(temp.NE)/numOfAllTrial;
+                        else
+                           errArray(j, t*numOfEP+m) = 0;
+                        end
+                end
+            end
+    end
+
+   dataOut.errSpssArray = errArray;
+    
+    
+    %% discard trial
+    dataTemp = [dataIn.train.dis;  dataIn.test.dis];
+    disArray = zeros(Exp.subNum, 2*(Exp.nEp + Exp.nEpT ));
+    for j = 1 : Exp.subNum % for each subject
+%         for iLeftRight = 1:2
+            for t = 0:1 % for old and new
+                for m = 1:(numOfEP) % for EP 1:6
+                    temp = dataTemp(dataTemp.NSub == j & dataTemp.New1 == t & dataTemp.NE == m,:);
+                    
+%                     if iLeftRight == 1% left
+                        if ~isempty(temp)
+                             numOfAllTrial = Exp.nTrl * Exp.numOfBlock.TrainEpoch/2 ;
+                             disArrayLeft(j, t*numOfEP+m) = 100*length(temp.NE)/numOfAllTrial;
+                        else
+                           disArrayLeft(j, t*numOfEP+m) = 0;
+                        end
+%                     else
+%                         temp = temp(temp.Crr2 == -2,:);
+%                         if ~isempty(temp)
+%                              numOfAllTrial = Exp.nTrl * Exp.numOfBlock.TrainEpoch/2 ;
+%                              disArrayRight(j, t*numOfEP+m) = 100*length(temp.NE)/numOfAllTrial;
+%                         else
+%                            disArrayRight(j, t*numOfEP+m) = 0;
+%                         end
+%                     end
+                end
+
+            end
+%         end
+    end
+    
+    dataOut.disSpssArray = disArray;
+    
+end

+ 27 - 0
dataProcessAll_Exp1.m

@@ -0,0 +1,27 @@
+%% xuelian zang
+%% 10/05/2013
+%% analyse all the data
+%% 
+function dataProcessAll_Exp1()
+
+try
+    close all
+    clc
+    clear all
+    Exp.nEp = 5;
+    Exp.nEpT = 1;
+    Exp.nTB = 5;
+    Exp.nTrl = 24;
+    Exp.nB = 25;
+    Exp.subNum = 16; 
+
+
+    load('Exp1_AllData.mat');
+    data = AllData;
+    
+    %generate a data set for SPSS Statistics
+    dataOutAll = dataProcessValid_Exp1(data,  Exp);   
+      
+catch ME
+    disp(ME.message);
+end

+ 26 - 0
dataProcessAll_Exp2.m

@@ -0,0 +1,26 @@
+%% xuelian zang
+%% 10/05/2013
+%% analyse all the data
+%% 
+function dataProcessAll_Exp2
+
+try
+    close all;
+    clc;
+    clear all;
+    Exp.nEp = 5;
+    Exp.nEpT = 1;
+    Exp.nTB = 5;
+    Exp.nB = 25;
+    Exp.nTrl = 24;
+
+    Exp.subNum = 16;
+    
+    load('Exp2_AllData.mat');
+    data = AllData;
+    dataOutAll = dataProcessValid(data,  Exp);
+
+
+catch ME
+    disp(ME.message);
+end

+ 51 - 0
dataProcessAll_Exp3.m

@@ -0,0 +1,51 @@
+%% xuelian zang
+%% 10/05/2013
+%% analyse all the data
+%%
+function dataProcessAll_Exp3()
+
+try
+    close all
+    clc
+    clear all
+    Exp.nEp = 5;
+    Exp.nEpT = 1;
+    Exp.nTB = 5;
+    Exp.nB = 25;
+    Exp.nTrl = 24;
+    Exp.numOfBlock.TrainEpoch = 5;
+    Exp.numOfBlock.TransferEpoch = 5;
+    
+    
+    RTTh.low = 0.2;
+    RTTh.ratio = 2.5;
+    RTTh.high_RT1 = 0; % 0: discard with ratio
+    RTTh.high_RT2 = 0;
+    
+    numOfDisTrials = 0;
+    
+    %% for all subjects
+    Exp.subNum = 16; %% 12 with positive cueing, 3 with negative cueing
+    
+    %% load Exp3 behavior data  
+    load('Exp3_AllData.mat');
+    data = AllData;
+    
+    dataOutAll = dataProcessValid_Exp3(data,  Exp);
+    
+    %%error and miss together
+    errData1 = calError(data, Exp);
+    mErrRates = mean(mean(errData1.errSpssArray,2))
+    
+    mErrRatesTrain = mean(mean(errData1.errSpssArray(:,[1:5 7:11]),2))
+    mErrRatesTransfer = mean(mean(errData1.errSpssArray(:,[6 12]),2))
+    
+    mDisRates = mean(mean(errData1.disSpssArray,2))
+    
+    %% hitFalseArray1: hitLeftSub, FALeft, hitRight, FARight
+    %% d: leftSub RightSub
+    [hitFalseArray, d] = procRec(data);
+    
+catch ME
+    disp(ME.message);
+end

+ 41 - 0
dataProcessValid_Exp1.m

@@ -0,0 +1,41 @@
+%Name:                dataProcessValid.m
+%
+%Autor:               Xuelian Zang
+%Description:         process valid data for selected subjects with stable
+%performance
+%
+%Date:                22/09/2015
+function dataOut = dataProcessValid_Exp1(dataIn,Exp)
+try
+  % for the training session
+  trainMeanSub = grpstats(dataIn.train.valid, {'New','NE','NSub'},{'mean','sem','numel'}, 'datavars','RT');
+  trainMeanAllCombine = grpstats(trainMeanSub, {'New','NE'},{'mean','sem','numel'}, 'datavars','mean_RT');
+  %o1E1 o1E2 o1E3 o1E4 o1E5    o0E1 o0E2 o0E3 o0E4 o0E5    
+  dataOut.forSpss.trainCombineCol = dataset({reshape(trainMeanSub.mean_RT, Exp.subNum, []),...
+      'o1E1', 'o1E2', 'o1E3', 'o1E4', 'o1E5' ,   'o0E1', 'o0E2', 'o0E3', 'o0E4', 'o0E5'} );
+ 
+ % precessing transfer data
+  testEp6MeanSub = grpstats(dataIn.test.valid, {'New','NE','NSub'},{'mean','sem','numel'}, 'datavars','RT');
+  testEp6MeanAll = grpstats(testEp6MeanSub, {'New','NE'},{'mean','sem','numel'}, 'datavars','mean_RT');
+  dataOut.forSpss.testEp6 = dataset({reshape(testEp6MeanSub.mean_RT, Exp.subNum, []),'old','new'});
+
+  %plot the reaction time of experiemnt 1
+    figure(); hold on; set(gcf,'Units','inches','Position',[2 2 6.83*0.5 6.83*0.5] );
+     title('Solo condition');
+     idxNew = (trainMeanAllCombine.New == 1 );
+      errorbar(1:Exp.nEp, trainMeanAllCombine.mean_mean_RT(idxNew, :), trainMeanAllCombine.sem_mean_RT(idxNew, :),'k-*');
+      idxOld = (trainMeanAllCombine.New == 0);
+      errorbar(1:Exp.nEp, trainMeanAllCombine.mean_mean_RT(idxOld, :), trainMeanAllCombine.sem_mean_RT(idxOld, :),'k-o');
+      errorbar(Exp.nEp+1, testEp6MeanAll.mean_mean_RT(1),testEp6MeanAll.sem_mean_RT(1),'k-o');
+      errorbar(Exp.nEp+1, testEp6MeanAll.mean_mean_RT(2),testEp6MeanAll.sem_mean_RT(2),'k-*');
+      xlabel('Epoch');
+      ylabel('Reaction time (in Secs)');
+      legend('boxoff');
+      legend( 'new','old');
+      xlim([0.5 6.5]);
+  hold off;
+  
+
+catch ME
+    disp(ME.message);
+end

+ 59 - 0
dataProcessValid_Exp2.m

@@ -0,0 +1,59 @@
+%Name:                dataProcessValid.m
+%
+%Autor:               Xuelian Zang
+%Description:         process valid data for selected subjects with stable
+%performance
+%
+%Date:                22/09/2015
+function dataOut = dataProcessValid_Exp2(dataIn,Exp)
+try
+
+  %% for the training session
+  trainMeanSub = grpstats(dataIn.train.valid, {'New1','NE','NSub'},{'mean','numel'}, 'datavars',{'RT1','RT2'});
+  trainMeanAllCombine = grpstats(trainMeanSub, {'New1','NE'},{'mean','sem','numel'}, 'datavars',{'mean_RT1','mean_RT2'});
+  %o1E1 o1E2 o1E3 o1E4 o1E5    o0E1 o0E2 o0E3 o0E4 o0E5    
+  dataOut.forSpss.trainRTLeftCombine = dataset({reshape(trainMeanSub.mean_RT1, Exp.subNum, []),...
+      'o1E1', 'o1E2', 'o1E3', 'o1E4', 'o1E5' ,   'o0E1', 'o0E2', 'o0E3', 'o0E4', 'o0E5'} );
+  dataOut.forSpss.trainRTRightCombine = dataset({reshape(trainMeanSub.mean_RT2, Exp.subNum, []),...
+      'o1E1', 'o1E2', 'o1E3', 'o1E4', 'o1E5' ,   'o0E1', 'o0E2', 'o0E3', 'o0E4', 'o0E5'} );
+
+  testEp6MeanSub = grpstats(dataIn.test.valid, {'New1','NE','NSub'},{'mean','numel'}, 'datavars',{'RT1', 'RT2'});
+  testEp6MeanAll = grpstats(testEp6MeanSub, {'New1','NE'},{'mean','sem','numel'}, 'datavars',{'mean_RT1', 'mean_RT2'});
+  dataOut.forSpss.testEp6RTLeft = dataset({reshape(testEp6MeanSub.mean_RT1, Exp.subNum, []),'old','new'});
+  dataOut.forSpss.testEp6RTRight = dataset({reshape(testEp6MeanSub.mean_RT2, Exp.subNum, []),'old','new'});
+ 
+  %treat left and right participants as different subjects and combine
+  %their data together 
+  dataCombine = dataset( {[trainMeanSub.New1    trainMeanSub.NE        trainMeanSub.NSub              trainMeanSub.mean_RT1; ...
+                           trainMeanSub.New1    trainMeanSub.NE        trainMeanSub.NSub+Exp.subNum   trainMeanSub.mean_RT2; ...
+                           testEp6MeanSub.New1  testEp6MeanSub.NE      testEp6MeanSub.NSub            testEp6MeanSub.mean_RT1; ...
+                           testEp6MeanSub.New1  testEp6MeanSub.NE      testEp6MeanSub.NSub+Exp.subNum testEp6MeanSub.mean_RT2;], ...
+                            'New', 'NE', 'NSub','meanRT'});
+                        
+  tmp = grpstats(dataCombine, {'New','NE','NSub'},{'mean','numel'}, 'datavars',{'meanRT'});                      
+  dataOut.forSpss.RTAllCombine = dataset({reshape(tmp.mean_meanRT, Exp.subNum*2, []),...
+       'o1E1', 'o1E2', 'o1E3', 'o1E4', 'o1E5' ,'o1E6','o0E1', 'o0E2', 'o0E3', 'o0E4', 'o0E5', 'o0E6'} );
+
+  dataCombineMean = grpstats(dataCombine, {'New','NE'},{'mean','sem','numel'}, 'datavars',{'meanRT'});
+    
+  
+  %plot the reaction time of experiemnt 2
+  figure(); hold on; set(gcf,'Units','inches','Position',[2 2 6.83*0.5 6.83*0.5] );
+   title('Joint condition');
+    errorbar(1:5, dataCombineMean.mean_meanRT(1:5),dataCombineMean.sem_meanRT(1:5), 'k-o');
+    errorbar(6, dataCombineMean.mean_meanRT(6),dataCombineMean.sem_meanRT(6), 'k-o');
+    
+    errorbar(1:5, dataCombineMean.mean_meanRT(7:11),dataCombineMean.sem_meanRT(7:11), 'k-*');
+    errorbar(6, dataCombineMean.mean_meanRT(12), dataCombineMean.sem_meanRT(12), 'k-*');
+    xlim([0.5 6.5]);
+    ylabel('Reaction time (in Secs)');
+    xlabel('Epochs');
+  hold off;
+
+  
+ 
+    
+
+catch ME
+    disp(ME.message);
+end

+ 125 - 0
dataProcessValid_Exp3.m

@@ -0,0 +1,125 @@
+%Name:                dataProcessValid.m
+%
+%Autor:               Xuelian Zang
+%Description:         process valid data for selected subjects with stable
+%performance
+%
+%Date:                22/09/2015
+function dataOut = dataProcessValid(dataIn,Exp)
+try
+
+  %plot black and white together
+  trainMeanSub_RT1 = grpstats(dataIn.train.valid(dataIn.train.valid.RT1 > 0, :), {'New1','NE','NSub'},{'mean','numel'}, 'datavars',{'RT1'});
+  if ~isempty(trainMeanSub_RT1)
+      trainMeanAllCombine_RT1 = grpstats(trainMeanSub_RT1, {'New1','NE'},{'mean','sem','numel'}, 'datavars',{'mean_RT1'});
+      %o1E1 o1E2 o1E3 o1E4 o1E5    o0E1 o0E2 o0E3 o0E4 o0E5    
+      subNumLeft = length(unique(trainMeanSub_RT1.NSub) );
+      dataOut.forSpss.trainRTLeftCombine = dataset({reshape(trainMeanSub_RT1.mean_RT1, subNumLeft, []),...
+          'o1E1', 'o1E2', 'o1E3', 'o1E4', 'o1E5' ,   'o0E1', 'o0E2', 'o0E3', 'o0E4', 'o0E5'} );
+  end
+  trainMeanSub_RT2 = grpstats(dataIn.train.valid(dataIn.train.valid.RT2 > 0, :), {'New1','NE','NSub'},{'mean','numel'}, 'datavars',{'RT2'});
+  if ~isempty(trainMeanSub_RT2)
+      trainMeanAllCombine_RT2  = grpstats(trainMeanSub_RT2, {'New1','NE'},{'mean','sem','numel'}, 'datavars',{'mean_RT2'});
+      subNumRight = length(unique(trainMeanSub_RT2.NSub) );
+      dataOut.forSpss.trainRTRightCombine = dataset({reshape(trainMeanSub_RT2.mean_RT2, subNumRight, []),...
+          'o1E1', 'o1E2', 'o1E3', 'o1E4', 'o1E5' ,   'o0E1', 'o0E2', 'o0E3', 'o0E4', 'o0E5'} );
+  end
+
+  %% test session, all color instruction reversed
+  testMeanSub_RT1 = grpstats(dataIn.test.valid(dataIn.test.valid.RT1 > 0, :), {'New1','NE','NSub'},{'mean','numel'}, 'datavars',{'RT1'});
+  if ~isempty(testMeanSub_RT1)
+        testMeanAllCombine_RT1 = grpstats(testMeanSub_RT1, {'New1','NE'},{'mean','sem','numel'}, 'datavars',{'mean_RT1'});
+        dataOut.forSpss.testRTLeft = dataset({reshape(testMeanSub_RT1.mean_RT1, subNumLeft, []),'old','new'});
+  end
+  testMeanSub_RT2 = grpstats(dataIn.test.valid(dataIn.test.valid.RT2 > 0, :), {'New1','NE','NSub'},{'mean','numel'}, 'datavars',{'RT2'});
+  if ~isempty(testMeanSub_RT2)
+    testMeanAllCombine_RT2 = grpstats(testMeanSub_RT2, {'New1','NE'},{'mean','sem','numel'}, 'datavars',{'mean_RT2'});
+    dataOut.forSpss.testRTRight = dataset({reshape(testMeanSub_RT2.mean_RT2, subNumRight, []),'old','new'});
+  end
+ 
+  if ~isempty(testMeanSub_RT1) &&  ~isempty(testMeanSub_RT2)
+     %combine the left and right participants together
+      dataCombine = dataset( {[ trainMeanSub_RT1.New1     trainMeanSub_RT1.NE        trainMeanSub_RT1.NSub       trainMeanSub_RT1.mean_RT1; ...
+                               trainMeanSub_RT2.New1      trainMeanSub_RT2.NE        trainMeanSub_RT2.NSub       trainMeanSub_RT2.mean_RT2; ...
+                               testMeanSub_RT1.New1       testMeanSub_RT1.NE         testMeanSub_RT1.NSub        testMeanSub_RT1.mean_RT1; ...
+                               testMeanSub_RT2.New1       testMeanSub_RT2.NE         testMeanSub_RT2.NSub        testMeanSub_RT2.mean_RT2;], ...
+                                'New', 'NE', 'NSub','meanRT'});
+      tmp = grpstats(dataCombine, {'New','NE','NSub'},{'mean','numel'}, 'datavars',{'meanRT'});                      
+      dataOut.forSpss.RTAllCombine = dataset({reshape(tmp.mean_meanRT, Exp.subNum, []),...
+       'o1E1', 'o1E2', 'o1E3', 'o1E4', 'o1E5' ,'o1E6','o0E1', 'o0E2', 'o0E3', 'o0E4', 'o0E5', 'o0E6'} );                     
+  elseif ~isempty(testMeanSub_RT1) 
+       %combine the left and right participants together
+        dataCombine = dataset( {[ trainMeanSub_RT1.New1     trainMeanSub_RT1.NE        trainMeanSub_RT1.NSub       trainMeanSub_RT1.mean_RT1; ...
+                                  testMeanSub_RT1.New1       testMeanSub_RT1.NE         testMeanSub_RT1.NSub        testMeanSub_RT1.mean_RT1;], ...
+                            'New', 'NE', 'NSub','meanRT'});
+          tmp = grpstats(dataCombine, {'New','NE','NSub'},{'mean','numel'}, 'datavars',{'meanRT'});                      
+        dataOut.forSpss.RTAllCombine = dataset({reshape(tmp.mean_meanRT, Exp.subNum, []),...
+       'o1E1', 'o1E2', 'o1E3', 'o1E4', 'o1E5' ,'o1E6','o0E1', 'o0E2', 'o0E3', 'o0E4', 'o0E5', 'o0E6'} );
+  else
+        dataCombine = dataset( {[trainMeanSub_RT2.New2      trainMeanSub_RT2.NE        trainMeanSub_RT2.NSub       trainMeanSub_RT2.mean_RT2; ...
+                                  testMeanSub_RT2.New1       testMeanSub_RT2.NE         testMeanSub_RT2.NSub        testMeanSub_RT2.mean_RT2;], ...
+                                'New', 'NE', 'NSub','meanRT'});      
+       tmp = grpstats(dataCombine, {'New','NE','NSub'},{'mean','numel'}, 'datavars',{'meanRT'});                      
+       dataOut.forSpss.RTAllCombine = dataset({reshape(tmp.mean_meanRT, Exp.subNum, []),...
+       'o1E1', 'o1E2', 'o1E3', 'o1E4', 'o1E5' ,'o1E6','o0E1', 'o0E2', 'o0E3', 'o0E4', 'o0E5', 'o0E6'} );
+  end
+
+  dataCombineMean = grpstats(dataCombine, {'New','NE'},{'mean','sem','numel'}, 'datavars',{'meanRT'});
+  
+  %plot all data together
+  figure(); hold on; set(gcf,'Units','inches','Position',[2 2 6.83*0.5 6.83*0.5] );
+    errorbar(1:5, dataCombineMean.mean_meanRT(1:5),dataCombineMean.sem_meanRT(1:5), 'k-o');
+    errorbar(6, dataCombineMean.mean_meanRT(6),dataCombineMean.sem_meanRT(6), 'k-o');
+    
+    errorbar(1:5, dataCombineMean.mean_meanRT(7:11),dataCombineMean.sem_meanRT(7:11), 'k-*');
+    errorbar(6, dataCombineMean.mean_meanRT(12), dataCombineMean.sem_meanRT(12), 'k-*');
+    xlim([0.5 6.5]);
+    ylabel('Reaction time (in Secs)');
+    xlabel('Epochs');
+  hold off;
+
+  
+%   nfig = ceil(sqrt(Exp.subNum) );
+%   figure(); hold on;
+%   for iSub = 1:Exp.subNum
+%       train = trainMeanSub(trainMeanSub.NSub == iSub, :);
+%       testEp6MeanSubTmp = testEp6MeanSub(testEp6MeanSub.NSub == iSub,:);
+%       subplot(nfig,nfig,iSub); hold on;
+%       plot(1:6, [train.mean_RT1(1:5); testEp6MeanSubTmp.mean_RT1(1) ]', 'r-o');
+%       plot(1:6, [train.mean_RT1(6:10); testEp6MeanSubTmp.mean_RT1(2) ]', 'r-*');
+% 
+%       plot(1:6, [train.mean_RT2(1:5); testEp6MeanSubTmp.mean_RT2(1) ]', 'b-o');
+%       plot(1:6, [train.mean_RT2(6:10); testEp6MeanSubTmp.mean_RT2(2) ]', 'b-*');
+%       
+%       ylabel('meanRT');
+%       xlabel('Epochs');
+%       set(gca,'XTick',[1:6]);
+%       if iSub == 1
+%       legend('oldLeft','newLeft','oldRight','newRight');
+%       end
+%       hold off
+%   end
+%   
+%   %plot all subjects together, separate left and right participant
+%   figure(); hold on;
+%       errorbar(1:6, [trainMeanAllCombine.mean_mean_RT1(1:5); testEp6MeanAll.mean_mean_RT1(1) ], ...
+%           [trainMeanAllCombine.sem_mean_RT1(1:5); testEp6MeanAll.sem_mean_RT1(1) ], 'r-o');
+%       errorbar(1:6, [trainMeanAllCombine.mean_mean_RT1(6:10); testEp6MeanAll.mean_mean_RT1(2) ], ...
+%            [trainMeanAllCombine.sem_mean_RT1(6:10); testEp6MeanAll.sem_mean_RT1(2) ],'r-*');
+% 
+%       errorbar(1:6, [trainMeanAllCombine.mean_mean_RT2(1:5); testEp6MeanAll.mean_mean_RT2(1) ],...
+%          [trainMeanAllCombine.sem_mean_RT2(1:5); testEp6MeanAll.sem_mean_RT2(1) ], 'b-o');
+%       errorbar(1:6, [trainMeanAllCombine.mean_mean_RT2(6:10); testEp6MeanAll.mean_mean_RT2(2) ], ...
+%           [trainMeanAllCombine.sem_mean_RT2(6:10); testEp6MeanAll.sem_mean_RT2(2) ], 'b-*');
+%      
+%       ylabel('meanRT');
+%       xlabel('Epochs');
+%       set(gca,'XTick',[1:6]);
+%       legend('oldLeft','newLeft','oldRight','newRight');
+%   hold off;
+%   
+
+
+catch ME
+    disp(ME.message);
+end

+ 34 - 0
procRec.m

@@ -0,0 +1,34 @@
+%% process recognition
+function  [hitFalseArray, d] = procRec(dataIn)
+try
+     maxNB = max(dataIn.rec.NB);
+     minNB = min(dataIn.rec.NB);
+     
+     %% put left and right subjects together
+     tmpRight = dataIn.rec(dataIn.rec.RP1 == -1 & dataIn.rec.RT1 == -1, 4:end);
+     tmpLeft = dataIn.rec(dataIn.rec.RP2 == -1 & dataIn.rec.RT2 == -1, [1:3 7:end]);
+     tmpData = dataset({[double(tmpLeft); double(tmpRight)], ...
+         'RP','RT','Crr','NT','NB','nConfig','LWhite', 'New1', 'TLoc1', 'RBlack', 'New2', 'TLoc2 ','NSub'});    
+    
+     recMeanSub = grpstats(tmpData, {'New1','NB','NSub'},{'mean','sem','numel'}, 'datavars',{'Crr'});
+     
+     hitRates = recMeanSub.mean_Crr(recMeanSub.New1 == 0,:);
+     crrReject = recMeanSub.mean_Crr(recMeanSub.New1 == 1,:);
+
+     %if the hit or correct rejection rate equals to 1 or 0,set them to 0.9999
+     %and 0.0001
+     hitRates(hitRates == 1) = 0.9999;
+     crrReject(crrReject == 0) = 0.0001;
+     hitRates(hitRates == 0) = 0.0001;
+     crrReject(crrReject == 1) = 0.9999;
+
+     
+     hitFalseArray = [hitRates  1-crrReject ];
+
+     %% calculate d'
+     d = [norminv( hitFalseArray (:,1) ) - norminv( hitFalseArray (:,2) )];
+        
+%
+catch ME
+    disp(ME.message);
+end