Main content

Home

Menu

Loading wiki pages...

View
Wiki Version:
**Description of analysis code for White, Palmer & Boynton, Psychological Science (in press)**: “Evidence of serial processing in visual word recognition” by Alex White, November 2017 contact: alexlw@uw.edu The zipped folder “AnalysisCode” contains Matlab scripts and functions to analyze each subject’s raw data, gather all the subjects’ data together, and create Figures 2 and 3 from the manuscript. Note: before trying to run the analysis, it would be best to put the following files and unzipped folders into one folder: AnalysisCode (and its subfolder SDTandAOC); Expt1_IndivData; Expt2_IndivData; ResultsFiles. The data folders are in the ["Data and Results" component][1] of this OSF project. `AnalyzeGroup.m` is a script that process each subject’s data file (e.g., S1AllDat.mat), gathers all subjects’ data into larger matrices that are averaged and can be used to compute statistics and make figures. At the top of the script you must first set the variable Experiment to 1 or 2, to choose which experiment to analyze. When analyzing each individual subject, `AnalyzeGroup` performs two analyses: one is the main analysis of accuracy for each judgment type (semantic, color) in dual-task and single-task conditions, for each side (left, right). That is used to make Figure 2. The other is what we call the “contingent accuracy analysis” of dual-task trials only, to examine the effect of accuracy of the other side’s judgment within each trial. That is used to make Figure 3. For the main analysis, `AnalyzeGroup` calls a function `analyzeSubj` that analyzes one subject’s `allDat` structure, producing a structure called called “r” that contains matrices for each measure in each condition. `analyzeSubj` in turn calls `analyzeTrials` to compute each measure of interest (AROC, dprime, etc) on a subset of trials. The output of `analyzeSubj` (the `r` structure) is saved in ResultsFiles/indiv/Expt1 (or Expt 2), with a name like S1Res.mat. “`r`” has many fields, each of which is a vector or matrix containing a measure in several conditions. For example, `r.AROC` is a 6-dimensional matrix with accuracy values of area under the ROC curve (Ag) for each condition. The dimensions of that matrix are indicated in the structure `r.valsByIndex.` The first field of `valsByIndex` indicates the meaning of the first dimension, and so on. For each dimension, the 1st entry collapses across all values of that dimension’s variable. Here are the contents of `r.valsByIndex`, and their meanings: - whichTask: [NaN (all), 1 (semantic), 2 (color)] - cueCond: [NaN (all), 0 (dual-task), 1 (single-task)] - respOrder: [NaN (all), 1 (1st response), 2 (second response, on dual-task trials)] - targSide: [NaN (all), 1 (left), 2 (right)] - congruent: [NaN (all), 0 (incongruent), 1 (congruent)] - targPres: [NaN (all), 0 (target absent), 1 (target present)] As an example, the command below would extract Ag values in the semantic task, for dual and single-task conditions, separately for the left and right sides: Ags = squeeze(r.AROC(2,2:3,1,2:3,1,1)); For the contingent accuracy analysis, `AnalyzeGroup` calls a function `analyzeSubj_ContingentAcc`, which also uses `analyzeTrials` and also returns a structure called “`r`”. Those “`r`” variables are saved in the same ResultsFiles subfolder but given names like “S1ContingentRes.mat.” Note however that the matrices contained in these “`r`” variables for the contingency analysis have a different internal organization than for the main analysis; they have only three dimensions (whichTask, targSide, and otherSideCorrect), as defined by `r.valsByindex`. After analyzing individual subjects, `AnalyzeGroup` uses a function `gatherGroupAverage` that takes in the filenames of all the individual results files, loads them in, and produces two variables. The first is called `allR`, which is a structure similar to r, but each matrix in the structure contains all subjects’ values for that data variable. Each matrix within `allR` therefore has one additional dimension than in the original '`r`' file, and that last dimension indexes subjects. The second is called `rAvg`, which is very similar to each individual '`r`' structure, but contains the average across all subjects. `rAvg` also has a sub-structure `SEM` that has standard errors across subjects for each data matrix. For the “main analysis”, the `allR` and `rAvg` variables are stored in the files X1_AnalysisRes.mat and X2_AnalysisRes.mat, within ResultsFiles/group. For the “contingent accuracy analysis”, those variables are stored in X1_ContingentAccRes.mat and X2_ContingentAccRes.mat. **Figure code:** Two Matlab scripts are provided: makeFig2_AOCs.m and makeFig3_ContingentAgScatter.m. Each script loads in group-level results files from the ResultsFiles/group folder, makes a figure, and prints some statistics to text files (WordDualTaskAOCStats.txt and ContingentAgStats.txt). There is also a subfolder with supporting code: SDTandAOC. This contains functions written by Alex White for signal detection theory analyses (e.g., dprime, ROC curves), and functions to make the AOC plot and fit the all-or-none serial model. **Matlab version** This code was tested with the following software: MATLAB Version: 9.1.0.441655 (R2016b) Operating System: Mac OS X Version: 10.12.2 Build: 16C68 Java Version: Java 1.7.0_75-b13 with Oracle Corporation MATLAB Version 9.1 (R2016b) Computer Vision System Toolbox Version 7.2 (R2016b) Statistics and Machine Learning Toolbox Version 11.0 [1]: https://osf.io/pa6cs/
OSF does not support the use of Internet Explorer. For optimal performance, please switch to another browser.
Accept
This website relies on cookies to help provide a better user experience. By clicking Accept or continuing to use the site, you agree. For more information, see our Privacy Policy and information on cookie use.
Accept
×

Start managing your projects on the OSF today.

Free and easy to use, the Open Science Framework supports the entire research lifecycle: planning, execution, reporting, archiving, and discovery.