# Table of Contents - [Introduction · iMap4 User Guidebook](#introduction-imap4-user-guidebook) - [Getting Started · iMap4 User Guidebook](#getting-started-imap4-user-guidebook) - [Installation and running the GUI · iMap4 User Guidebook](#installation-and-running-the-gui-imap4-user-guidebook) - [Overview · iMap4 User Guidebook](#overview-imap4-user-guidebook) - [Theory · iMap4 User Guidebook](#theory-imap4-user-guidebook) - [Power analysis of iMap4 · iMap4 User Guidebook](#power-analysis-of-imap4-imap4-user-guidebook) - [Pixel Wise Modeling and non-parametric statistics · iMap4 User Guidebook](#pixel-wise-modeling-and-non-parametric-statistics-imap4-user-guidebook) - [Family-wise error rate (FWER) under H0 · iMap4 User Guidebook](#family-wise-error-rate-fwer-under-h0-imap4-user-guidebook) - [Linear Mixed Models · iMap4 User Guidebook](#linear-mixed-models-imap4-user-guidebook) - [Core functions · iMap4 User Guidebook](#core-functions-imap4-user-guidebook) - [Input Matrix · iMap4 User Guidebook](#input-matrix-imap4-user-guidebook) - [LMMmap · iMap4 User Guidebook](#lmmmap-imap4-user-guidebook) - [Example 1 (GUI) · iMap4 User Guidebook](#example-1-gui-imap4-user-guidebook) - [Using the GUI (1): Import Data and label columns · iMap4 User Guidebook](#using-the-gui-1-import-data-and-label-columns-imap4-user-guidebook) - [Using the GUI (3): Create smoothed fixation matrix · iMap4 User Guidebook](#using-the-gui-3-create-smoothed-fixation-matrix-imap4-user-guidebook) - [Using the GUI (4): Optional for preprocessing · iMap4 User Guidebook](#using-the-gui-4-optional-for-preprocessing-imap4-user-guidebook) - [Using the GUI (2): Parameters and Conditions · iMap4 User Guidebook](#using-the-gui-2-parameters-and-conditions-imap4-user-guidebook) - [Using the GUI (5): Descriptive Statistics Report · iMap4 User Guidebook](#using-the-gui-5-descriptive-statistics-report-imap4-user-guidebook) - [Other useful features and function · iMap4 User Guidebook](#other-useful-features-and-function-imap4-user-guidebook) - [Using the GUI (6): Spatial Mapping Using Linear Mixed Models · iMap4 User Guidebook](#using-the-gui-6-spatial-mapping-using-linear-mixed-models-imap4-user-guidebook) - [Background of Example 2 · iMap4 User Guidebook](#background-of-example-2-imap4-user-guidebook) - [Example 2 (Code) · iMap4 User Guidebook](#example-2-code-imap4-user-guidebook) - [Using the GUI (7): Hypothesis testing and Display results · iMap4 User Guidebook](#using-the-gui-7-hypothesis-testing-and-display-results-imap4-user-guidebook) - [References · iMap4 User Guidebook](#references-imap4-user-guidebook) - [Future development · iMap4 User Guidebook](#future-development-imap4-user-guidebook) - [Background of Example 1 · iMap4 User Guidebook](#background-of-example-1-imap4-user-guidebook) - [Additional information · iMap4 User Guidebook](#additional-information-imap4-user-guidebook) - [Example 3 - Simulation Study A · iMap4 User Guidebook](#example-3-simulation-study-a-imap4-user-guidebook) - [Analysis using codes: example 2 · iMap4 User Guidebook](#analysis-using-codes-example-2-imap4-user-guidebook) - [Using the GUI (8): Post-hoc analysis · iMap4 User Guidebook](#using-the-gui-8-post-hoc-analysis-imap4-user-guidebook) - [Credit and other information · iMap4 User Guidebook](#credit-and-other-information-imap4-user-guidebook) - [Example 4 - Simulation Study B · iMap4 User Guidebook](#example-4-simulation-study-b-imap4-user-guidebook) - [Page Not Found · GitBook (Legacy)](#page-not-found-gitbook-legacy-) - [Page Not Found · GitBook (Legacy)](#page-not-found-gitbook-legacy-) --- # Introduction · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/#) AA SerifSans WhiteSepiaNight [Introduction](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ======================================================================== ![iMap4 Guidebook Cover](https://junpenglao.gitbooks.io/imap4_guidebook/content/cover.jpg) ### _i_Map4 is a Matlab Toolbox for the spatial mapping of eye movement data (e.g., fixations) using Linear Mixed Model and non-parametric statistics. [Github Repository](https://github.com/iBMLab/iMap4) ===================================================== ##### Citing _i_Map4 Lao, J., Miellet, S., Pernet, C., Sokhn, N., & Caldara, R. (2016). _i_Map4: An Open Source Toolbox for the Statistical Fixation Mapping of Eye Movement data with Linear Mixed Modeling. _Behavior Research Methods._ [doi: 10.3758/s13428-016-0737-x](http://link.springer.com/article/10.3758/s13428-016-0737-x) results matching "" =================== No results matching "" ====================== --- # Getting Started · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_intro.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_intro.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_intro.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_intro.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_intro.html#) AA SerifSans WhiteSepiaNight [Getting Started](https://junpenglao.gitbooks.io/imap4_guidebook/content/) =========================================================================== Getting Started =============== * [Overview](https://junpenglao.gitbooks.io/imap4_guidebook/content/Overview.html) * [Installation and running the GUI](https://junpenglao.gitbooks.io/imap4_guidebook/content/Installation-and-running-the-GUI.html) results matching "" =================== No results matching "" ====================== --- # Installation and running the GUI · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Installation-and-running-the-GUI.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Installation-and-running-the-GUI.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Installation-and-running-the-GUI.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Installation-and-running-the-GUI.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Installation-and-running-the-GUI.html#) AA SerifSans WhiteSepiaNight [Installation and running the GUI](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ============================================================================================ Installation and running the GUI -------------------------------- _i_Map4 requires Matlab 2013b (version 8.2) or above with the Image Processing Toolbox and the Statistics Toolbox. If your Matlab environment is equipped with the Parallel Computing Toolbox, some function will launch in parallel to speed up the computation. To installation _i_Map4, simply unzip the .zip file, direct to ./Matlab\_Installation\_Package and double click the iMap4.mlappinstall. Or you can download [iMap4.mlappinstall](https://github.com/iBMLab/iMap4/releases/download/v1.0/iMap4.mlappinstall) directly. ![iMap4 Installation1](http://i.imgur.com/R9iqIqg.png) _i_Map 4 is then installed on your Matlab software as an application. You can now click on the Apps tab on Matlab main window to locate the app. You can also find the content of _i_Map4 under your default Matlab search path: ./MATLAB/Apps/iMap4 ![iMap4 Installation2](http://i.imgur.com/G35b9Th.png) Launch _i_Map4 GUI simply by clicking the app or type >>iMAP in your command window ![iMap4 Installation2](http://i.imgur.com/8H4shFu.png) _You can click on the **?** to open this wiki_ results matching "" =================== No results matching "" ====================== --- # Overview · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Overview.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Overview.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Overview.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Overview.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Overview.html#) AA SerifSans WhiteSepiaNight [Overview](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ==================================================================== Overview -------- ![iMap4 Procedure](http://i.imgur.com/kMlefnb.png) _i_Map4 is an open source Matlab toolbox for the statistical fixation mapping of eye movement data, implementing a user-friendly interface that provides straightforward, easy to interpret statistical graphical outputs. _i_Map4 matches the standards of the robust statistical analysis implemented in neuroimaging techniques (M/EEG, fMRI). _i_Map4 applies univariate, pixel-wise Linear Mixed Models (LMM) on the smoothed fixation maps with each subject as one of the random effects, which offers the flexibility to code for multiple between- and within- subject comparisons. Users can perform all possible linear contrasts for the fixed effects (main effects, interactions, etc.). Importantly, it implements non-parametric statistics based on resampling. We developed a novel spatial cluster test based on bootstrapping to assess the statistical significance of the linear contrasts. We hope that _i_Map4 could provide an easy access to the routine use of robust data-driven analyses in spatial fixation mappings. The methodological details of the spatial mapping using Linear Mixed Models and the resampling algorithm, as well as the validation of statistics implemented in _i_Map4 are provided in a peer reviewed paper (currently under review). For a general thoughtful introduction to mixed models, users of the toolbox should refer to Raudenbush & Bryk (2002), McCulloch, Searle & Neuhaus (2011), and Christensen (2011). We recommend _i_Map4 users also read Baayen, Davidson & Bates (2008) and Bolker et al., (2009) for some examples on how to perform and report mixed model analysis.   results matching "" =================== No results matching "" ====================== --- # Theory · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_theory.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_theory.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_theory.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_theory.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_theory.html#) AA SerifSans WhiteSepiaNight [Theory](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ================================================================== Theory ====== * [Linear Mixed Models](https://junpenglao.gitbooks.io/imap4_guidebook/content/Linear-Mixed-Models.html) * [Pixel Wise Modeling and non-parametric statistics](https://junpenglao.gitbooks.io/imap4_guidebook/content/Pixel-Wise-Modeling-and-non-parametric-statistics.html) * [Family-wise error rate (FWER) under H0](https://junpenglao.gitbooks.io/imap4_guidebook/content/Family-wise-error-rate-FWER-under-H0.html) * [Power analysis of iMap4](https://junpenglao.gitbooks.io/imap4_guidebook/content/Power-analysis-of-iMap4.html) For more details, please consult the _i_Map4 paper published in Behavior Research Methods: Lao, J., Miellet, S., Pernet, C., Sokhn, N., & Caldara, R. (2016). _i_Map4: An Open Source Toolbox for the Statistical Fixation Mapping of Eye Movement data with Linear Mixed Modeling. Behavior Research Methods. [doi: 10.3758/s13428-016-0737-x](http://link.springer.com/article/10.3758/s13428-016-0737-x) results matching "" =================== No results matching "" ====================== --- # Power analysis of iMap4 · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Power-analysis-of-iMap4.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Power-analysis-of-iMap4.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Power-analysis-of-iMap4.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Power-analysis-of-iMap4.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Power-analysis-of-iMap4.html#) AA SerifSans WhiteSepiaNight [Power analysis of iMap4](https://junpenglao.gitbooks.io/imap4_guidebook/content/) =================================================================================== Power analysis of _i_Map4 ------------------------- We are currently running more follow up simulation studies to estimate the power of _i_Map4 under various conditions. Please stay tuned. ;-) results matching "" =================== No results matching "" ====================== --- # Pixel Wise Modeling and non-parametric statistics · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Pixel-Wise-Modeling-and-non-parametric-statistics.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Pixel-Wise-Modeling-and-non-parametric-statistics.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Pixel-Wise-Modeling-and-non-parametric-statistics.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Pixel-Wise-Modeling-and-non-parametric-statistics.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Pixel-Wise-Modeling-and-non-parametric-statistics.html#) AA SerifSans WhiteSepiaNight [Pixel Wise Modeling and non-parametric statistics](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ============================================================================================================= Pixel-Wise Modelling and non-parametric statistics -------------------------------------------------- ### Pixel-Wise Modelling Although the generation mechanism of eye movement data is still largely under debate, recent theories and applications suggest that a spatial model is the most appropriate to consider the statistical analysis of fixation especially its location distribution. For example, Barthelmé, Trukenbrod, Engbert, & Wichmann, (2013) recommend using the point process framework to inference how fixations are distributed in space. While we endorse this fruitful approach and its Bayesian nature, here we aim to resolve this problem from an opposite perspective. Instead of inferring from the spatial distribution of the fixation, we infer on each location in the search space (i.e., each pixel of within the eye tracker recordable range or each pixel in the visible stimuli). In other words, we try to answer the question: _“How long is this pixel being fixated (or what is the probability of this pixel to be fixated) in the function of the experimental conditions?”_. Formally, by applying mixed models independently on each pixel, we have: > _**Y**(s)_ = _**Xβ**(s)_ + _**Zb**(s)_ + _**ε**(s)_ > > _for s ∈ **D** of the search space_ The complete procedure as implemented in _i_Map4 is explained in the figure below. Eye movement data for each participant is concatenated into one input data matrix. _i_Map4 first partition the data matrix into a fixation characteristic matrix _(red box)_ and an experiment condition information matrix _(green box)_. The fixation characteristic matrix contains fixation spatial location (_x_ and _y_), fixation duration, and order index of each fixation. The experiment condition matrix contains the index of each subject, index of each trial/item, and different levels of each experimental condition. Fixation durations are then projected into the two-dimensional space according to their _x_ and _y_ coordinates at the single-trial level. _i_Map4 then smooths the fixation duration map by convoluting it with a two-dimension Gaussian Kernel function: > _Kernel_ ~ **Ν** (0,σ2 _Ι_), where I is a two by two identity matrix and the full width at half maximum (FWHM) of the Kernel is _1° visual angle_ as the default setting. This step is essential to account for the spatial uncertainty of eye movement recording (both mechanical and physiological) and the sparseness of the fixation locations. The Gaussian kernel could also be replaced by other 2D spatial filters to best suit the research question. ![iMap4 Procedure](http://i.imgur.com/kMlefnb.png) _Illustration of the procedure in iMap4. The input data matrix is partitioned into eye movement matrix and predictor matrix. Fixation durations are projected into the two-dimensional space according to their x and y coordinates at the single trial level for each participant. The experimental information of each trial is also summarised in a predictor table. Subsequently, the sparse representation of the fixation duration map is smoothed by convoluting it with a two dimensions Gaussian Kernel function Kernel ~ **Ν** (0,σ2 Ι). After estimating the fixation bias of each condition independently for all the observers (by taking the expected values across trial within the same condition), iMap4 models the 3D smoothed fixation map (item × xSize × ySize) independently for each pixel using a LMM. The result is saved as a Matlab structure in [LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) . iMap4 offers many parametric and non-parametric methods for hypothesis testing and multiple comparison corrections._ The resulting smoothed fixation map is a 3D matrix. The last two dimensions of the fixation matrix are the size of the stimuli/search space. Information of each entry in the first dimension is stored in a predictor table, which is generated from the experiment condition matrix. Each experiment condition can be coded at the single trial level in the predictor table, or as one entry by taking the average map across trials. In addition, _i_Map4 provides robust estimation option by applying Winsorization to limit extreme values in the smoothed fixation matrix. The goal here is to reduce the effect of potential outliers. Additional options include spatial normalisation (z-scored map or probability map), spatial downsampling (linear transformation using _imresize_ in Matlab) to optimise computing speed, and mask creation to exclude irrelevant pixels. The resulting 3D fixation matrix is then modelled in a LMM as the response variable. The results are saved as a Matlab structure ([LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) as in the examples below). The fields of [LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) are nearly identical to the output from _LinearMixedModel_ class. For each modelled pixel, _i_Map4 saves the model criterion, variances explained, error sum of squares, coefficient estimates and their covariance matrix for both fixed and random effects, and the ANOVA results on the LMM. Additional modelling specifications, as well as other model parameters including LMM formula, design matrix for fixed and random effect, and residual degrees of freedom, are also saved in LMMmap. Linear contrasts and other analyses based on variance or covariance can be performed afterwards from the model fitting information. Any other computation on the _LinearMixedModel_ output can also be replicated on [LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) . * * * ### Non-parametric statistics using permutation and bootstrap spatial clustering One of the crucial assumptions of pixel-wise modelling is that all pixels are independent and identically distributed. Of course, this assumption is never satisfied neither before nor after smoothing. To ensure valid inferences on activity patterns in large 2D pixel space, we applied non-parametric statistics to resolve the biases in parameter estimation and problems arising from multiple comparisons. We developed two resampling-based statistical hypothesis testing methods for the fixed effect coefficients: a universal permutation test and a universal bootstrap clustering test. The resampling tests on the model coefficient for fixed effects _**β**_ are operated on the fixed effect related variances. To do so, we simply removed the variance associated with the random effects from the response matrix: > _**Yfixed**(s)_ = _**Xβ**(s)_ + _**ε**(s)_ = _**Y**(s)_ - _**Zb**(s)_ > > _for s ∈ **D** of the search space_ For any permutation test, _i_Map4 performs the following algorithms on _**Yfixed**_ for each pixel: > #### Algorithm 1: > > For a given hypothesis or linear contrast _**c**_, _i_Map4 > > 1. Performs a linear transformation on the design matrix _**X**_ to get a new design matrix _**M**_ so that the partitioning of _**M**_ = \[ _**M1**_ , _**M2**_ \]. Then _i_Map4 computes the new coefficients by projecting _**Yfixed**_ to the pseudoinverse of _**M**_. The design matrix _**M**_ is created so that the original hypothesis testing is equivalent to the hypothesis regarding _**M1**_ coefficients. The matrix transformation and partition are the same as the algorithm described in Winkler et al (2014, appendix A) > 2. Computes the residuals related to the hypothesis by subtracting the variance accounted by _**M2**_ from _**Yfixed**_ to get _**Yrr**_ > 3. Fits _**Yrr**_ to _**M**_ by solving _**Yrr**_ = _**Mβm**_ + _**ε**_, and get the statistics value _**Frr**_ of _**M1**_. Note that to replicate the original hypothesis testing on the fixed effect, the new contrast _**c1**_ is just to partition _**M**_ into _**M1**_ and _**M2**_ > 4. Permutes the rows of the design matrix _**M**_ to obtain the new design matrix _**M \***_ > 5. Fits _**Yrr**_ to _**M \***_ and gets the _**Frr \***_ of _**M1 \***_ > 6. Repeats step (4) and (5) for a large number of times (_k resamplings/repetitions_), the _p_\-value is then defined as _p_ =(# _**Frr \***_ ≥ _**Frr**_ ) / _k_. Importantly, the FWER corrected _p_\-value is computed by comparing the largest _**Frr \***_ across all tested pixels in one resampling with the original _**Frr**_. **Algorithm 1** is a simplified version of Winkler et al (2014, Algorithm 1): the resampling table includes permutation but not sign-flipping. Sign-flipping assumes the errors to be independent and symmetric. Thus, the underlying assumptions are stronger than with classical permutations, which require only exchangeable errors (Winkler et al, 2014). Importantly, this test is exact only under a balanced design with no missing value and only subject as the random effect. As previously shown in Kherad-Pajouh and Renaud (2014), a general and exact permutation approach for mixed-model designs should be performed on modified residuals that have up to second-moment exchangeability. This is done to satisfy the important assumptions for repeated measures ANOVA: normality and sphericity of the error. However, there are strict requirements to achieve this goal: careful transformation and partition of both fixed and random effects design matrices, and removal of the random effects related to _**M2**_ (Kherad-Pajouh and Renaud, 2014). In _i_Map4, we perform an approximation version by removing all random effects to increase the efficiency and the speed of the huge amount of resampling computation in our pixel-wise modelling algorithm. Validation and simulation data set indeed showed that the sensitivity and the false alarm rate of the proposed algorithm are not compromised. _i_Map4 performs the following algorithm on _**Yfixed**_ for each pixel as the bootstrap clustering approach: > #### Algorithm 2: > > 1. For each unique categorical variable, _i_Map4 removes the conditional expectations from _**Yfixed**_ for each pixel. A random shuffling is then performed on the centered data to acquire _**Yc**_ , so that any potential covariance is also disrupted. This is done to construct the true empirical null hypothesis distribution in which all elements and their linear combinations in _**Yc**_ have expected values equal to zero. > 2. Randomly draws with replacement from { _**X**_ , _**Z**_ , _**Yc**_ } an equal number of subjects { _**X \***_ , _**Z \***_ , _**Yc \***_ } > 3. Fits _**Yc \***_ to _**X \***_ by solving _**Yc \***_ = _**X \***_ _**β \***_ + _**ε**_. For a given hypothesis or linear contrast _**c**_ , _i_Map4 computes the statistics value _**F \***_ and its parametric _p_\-value under the GLM framework. > 4. Thresholds statistical maps _**F \***_ at _p\*_ ≤ .05 and records the desired maximum cluster characteristics across all significant clusters. Cluster characteristics considered are: cluster mass (summed _F_ value within a significant cluster), cluster extent (size of the cluster), or cluster density (mean _F_ value within clustering). > 5. Repeats step (2), (3) and (4) a large number of times to get the cluster characteristic distribution under the null hypothesis H0. > 6. Thresholds the original statistics map _**F**_ at _p_ ≤ .05 and compares the selected cluster characteristic with the value of the null distribution corresponding to the 95th percentile. Any cluster with the chosen characteristic larger than this threshold is considered significant. The bootstrap clustering approach is identical to the bootstrap procedure described by Pernet et al. (2011; 2014) if only subject intercept is considered as the random effect. In addition, **Algorithm 2** extents the philosophy and approach presented by Pernet et al. (2011; 2014) to non-hierarchical mixed-effect models. It is worth noting that we implemented in _i_Map4 a high-performance algorithm to minimise the computational demands for a large amount of resampling. Model fitting in both resampling approaches makes use of Ordinary Least Squares. The inversion of the covariance matrixes is computed on the upper triangular factor of the Cholesky decomposition. Calculation of the quartic form for all pixels is optimised by constructing a sparse matrix of the inversion of the covariance matrix. More details of these algebra simplifications could be found in the imapLMMresample function in _i_Map4. Other multiple comparison correction methods such as Bonferroni correction, False Discovery Rate (FDR), or Random Field Theory (RFT) could also be applied. A Threshold-Free Cluster Enhancement (TFCE) algorithm could also be applied to the statistical (_**F**_\- value) maps as an option after the permutation and bootstrap clustering procedure (Smith & Nichols, 2009). results matching "" =================== No results matching "" ====================== --- # Family-wise error rate (FWER) under H0 · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Family-wise-error-rate-FWER-under-H0.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Family-wise-error-rate-FWER-under-H0.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Family-wise-error-rate-FWER-under-H0.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Family-wise-error-rate-FWER-under-H0.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Family-wise-error-rate-FWER-under-H0.html#) AA SerifSans WhiteSepiaNight [Family-wise error rate (FWER) under H0](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ================================================================================================== Family-wise error rate (FWER) under H0 -------------------------------------- We performed a validation study to access the type I error rate when applying the permutation and bootstrap clustering approach for hypothesis testing. We used a balanced repeated measurement ANOVA design with a two-level between-group factor and a three-level within-group factor. A total population of 134 observers (67 each group) was drawn from the previous face viewing eye-movement studies. We centred the cell means for the whole dataset to obtain the validation dataset under the null hypothesis. Thus, we used real data to warrant realistic distributions and centred them to ensure that H0 was confirmed. Any significant output from iMap4 performed on this dataset is considered as false alarm (Type I error). The validation procedure follows the steps below: we first randomly sampled without replacement a balanced number of subjects from both groups. We then ran _i_Map4 under the default setting and perform hypothesis testing on the two main effects and the interaction. To estimate the Family-wise error rate (FWER), we computed the frequency of significant output under different statistics and MCC setting. Preliminary results based on 1000 randomizations on a sample size of n ∊ \[8, 16, 32, 64\] showed that with an alpha of .05, the family-wise error rates are indeed all under .05 using non-parametric statistics (see Figure 2b for permutation test, 2c & 2d for bootstrap clustering test). More simulations considering a wider range of scenarios will be required to understand fully the behaviour of the proposed approaches, although cluster stats are likely to behave as in Pernet et al. (2014). ![fwer_imap4](http://i.imgur.com/6tLsqhN.png) The above figure is the validation result of the proposed resampling procedure as statistical inference. a) The family-wise error rate using the uncorrected parametric p-value. All FWER are significantly above .05. b) The family-wise error rate using the permutation approach (Algorithm 1). c) The family-wise error rate using the proposed bootstrap clustering approach (Algorithm 2) thresholds on cluster mass. d) The family-wise error rate using the proposed bootstrap clustering approach (Algorithm 2) thresholds on cluster extent. Notice that the FWER of a) and b) are computed at the pixel level (i.e., the proportion of false positive pixels across simulations), while the FWER of c) and d) are calculated at test level (i.e., the percentage of any false positive per test for the 1000 simulation). Error bar shows the standard error. results matching "" =================== No results matching "" ====================== --- # Linear Mixed Models · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Linear-Mixed-Models.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Linear-Mixed-Models.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Linear-Mixed-Models.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Linear-Mixed-Models.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Linear-Mixed-Models.html#) AA SerifSans WhiteSepiaNight [Linear Mixed Models](https://junpenglao.gitbooks.io/imap4_guidebook/content/) =============================================================================== Linear Mixed Model ------------------ ### Linear Mixed Model - a brief demo: In a GLM setting, > _y_ = **X**_β_ + _ε_ only _ε_ is the random effect: ![regression1](http://i.imgur.com/PwIoS2j.png) _ε_ is normally distributed and has a mean of zero. If you applied regression with such assumption, then it doesn't matter your data is actually from multiple subjects: ![regression2](http://i.imgur.com/F3oqIa2.png) _The data are the same as above, with each subject outlined in different color_ In real life research, things usually get messy, for example: ![random intercept model](http://i.imgur.com/lhxsEgN.png) or ![random intercept and slope model](http://i.imgur.com/1DIUx7A.png) And these situations can be handle perfectly in a Linear Mixed Model, which expressed these effect as random: > _y_ = **X**_β_ + **Z**_b_ + _ε_ In ![random intercept model](http://i.imgur.com/lhxsEgN.png), we can expressed the subject intercept as the random effect, which gives us a random intercept model. In ![random intercept and slope model](http://i.imgur.com/1DIUx7A.png), we just add the fixed predictor as a separate column into the **Z** from above, returning a random intercept and slope model. And the same could be applied with categorical predictor, for example, a random slope model below (with no random intercept): ![Categorical model](http://i.imgur.com/rapztZA.png) Using linear mixed model, you can take into account effects such as mixed-effect (i.e., both within- and between- subject effect) and repeated measurements. And with _i_Map4, you can now apply this powerful model on your eye tracking data as well! Mixed model is a complex subject, and many underlying details are beyond the scope of this paper. For a general thoughtful introduction to mixed models, users of the toolbox should refer to Raudenbush & Bryk (2002) and McCulloch, Searle & Neuhaus (2011). * * * ### Linear Mixed model in Matlab _i_Map4 calls [_LinearMixedModel_](http://uk.mathworks.com/help/stats/linearmixedmodel-class.html) from Matlab for model estimations. You can find the relate concepts in Matlab help file: [Linear Mixed-Effects Models](http://www.mathworks.com/help/stats/linear-mixed-effects-models.html) This page explains the basic concept of Linear Mixed Model. [Estimating Parameters in Linear Mixed-Effects Models](http://www.mathworks.com/help/stats/estimating-parameters-in-linear-mixed-effects-models.html) This page explains the methods for estimating parameters in Matlab: Maximum likelihood estimation (ML) and Restricted maximum likelihood estimation (ReML). [Linear formula notation (Wilkinson Notation)](http://www.mathworks.com/help/stats/wilkinson-notation.html) This page explains how to express your linear formula. results matching "" =================== No results matching "" ====================== --- # Core functions · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Core-functions.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Core-functions.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Core-functions.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Core-functions.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Core-functions.html#) AA SerifSans WhiteSepiaNight [Core functions](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ========================================================================== Core functions -------------- ### Model fitting * **imapLMM** - Core function of _i_Map4. It called Matlab class [_LinearMixedModel_](http://uk.mathworks.com/help/stats/linearmixedmodel-class.html) from Statistics Toolbox™ (R2013b or above) to estimate the LMM function. > Usage: \[[LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html)\ > , lmexample\] = **imapLMM**([FixMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) > , [PredictorM](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) > , [Mask](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) > , opt, formula, varargin) > > > FixMap - total number of items × xSize × ySize > > PredictorM - dataset format of condition Matrix, total number of items × number of predictor. > > Categorical column must set to nominal > > Mask - 2D mask, for reducing the number of computation > > opt - structure. option to define parallel grid (opt.parallelname) > > and option to compute each single categorical condition beta (opt.singlepredi) > > formula/varargin - same as fitlme, type '>>help fitlme' for more information > > * **imapGLMM** - same usage as **imapLMM**, but instead of fitting a Linear Mixed Model it fits a Generalized Linear Mixed Model. It gives you the possibility to fit other distribution in the exponential family. However, you cannot perform spatial clustering on the output yet - we are still developing appropriate method for the statistical testing of spatial GLMM model. * * * ### Statistics and Hypothesis testing * **imapLMMcontrast** - It takes [LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) and outputs the conventional model fitting parameters and model statistics in [StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) . > Usage: [StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) > = **imapLMMcontrast**([LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) > , opt) > > > opt is a structure specifying the statistics in [StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) > > . > > > > opt.type - model/fixed/random/model beta/predictor beta > > opt.alpha - default 0.05 > > opt.c - for coefficients and Catepredictors only, cell array containing contrast vector/matrix > > opt.h - for coefficients and Catepredictors only, cell array containing hypothesis vector/matrix > > opt.onetail - option to do onetail test, perform on two tail threshold for convenience (alpha/2) > > opt.name - for coefficients and Catepredictors only, name of each contrast (for plotting) > > * **imapLMMmcc** - We need to account for the Type I error resulting from massive univariate, pixel-wise testing before we can interpret the statistical output from **imapLMMcontrast**. Using **imapLMMmcc**, you can either 1) apply conventional multiple comparison correction on the _p_\-value; 2) apply non-parametric statistics based on resampling that have good control for both Type I and II error. We highly recommend option 2). In _i_Map4 we developed and implemented two resampling algorithms: a) permutation, b) bootstrap spatial clustering. Resampling is performed in **imapLMMresampling**. > Usage: StatMap\_c = **imapLMMmcc**([StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) > , [LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) > , mccopt, varargin) > > > mccopt is a structure specifying the method for multiple comparison problem. > > > > mccopt.methods - fdr/bonferroni/randomfield/cluster/bootstrap/permutation > > mccopt.bootopt - 1 cluster mass, 2 cluster size, 3 both cluster mass and size, 4 cluster dense > > mccopt.bootgroup- grouping variable for bootstrap and permutation (to keep group variance constant). > > Input must be a cell specifying a Group variables in the PredictorM > > mccopt.sbjvec - subject vector for bootstrap. > > Input must be a cell specifying a Group variables in the PredictorM. > > This is important when there are multiple grouping variables in the mixed model such as (1|subject) + (1|stimuli) > > mccopt.nboot - number of resampling for bootstrap or permutation > > mccopt.sigma - smoothing parameter (for Random field test) > > mccopt.clustSize- cluster size threshold (for cluster test) > > mccopt.clustVal - cluster value threshold (for cluster test) > > mccopt.parametic- for FDR > > mccopt.tfce - signal enhancement base on Threshold-free cluster enhancement developed by Smith & Nichols, 2009 > > > > > > varargin - replace it with [FixMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) > > for resampling algorithm. New statistics are save in the original [StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) as a updated output [StatMap\_c](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) * **imapLMMresample** - It performs a nonparametric statistical test by calculating Monte-Carlo estimates of the significance probabilities and/or critical values from the resampling distribution. This function is called by **imapLMMmcc** internally with bootstrap or permutation option, but you can call it independently as well. > Usage: ResampStat = **imapLMMresample**([FixMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) > , [LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) > , c, h, effect, method, nboot, grouping, rmRE, varargin) > > > FixMap - same one you used in imapLMM > > LMMmap - output of imapLMM. > > c - contrast matrix > > h - hypothesis matrix > > effect - fixed/random > > method - permutation/bootstrap > > nboot - number of resampling > > grouping - specify group index to keeping the group variance constant > > rmRE - 1 remove random effect, 0 keeping subject variance > > varargin - Optional: specify a subject vector. This is important when > > there are multiple grouping variables exist in the mixed model > > such as (1|subject) + (1|stimuli) > > > > > > Output: > > ResampStat - A structure with field {parameters} {resampleTABLE} {resampleFvalue} {resamplePvalue} {resmapleBeta} * * * ### Figure output and Post-Hoc analysis * **imapLMMdisplay** - It displays output of **imapLMMcontrast** or **imapLMMmcc**. > Usage: **imapLMMdisplay**([StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) > , normalized, backgroundfile, colourmap, colormaprange, distplot, foldername) > > > normalized - colormap value will be normalized [1] as default for multiple contrast. > > backgroundfile could be [image path]/[matrix]/[empty] > > colormap could be predefined. iMap4 implemented a red-blue map as default but looks not as good as the new colormap parula in Matlab > > output distribution of statistic value (optional, default 0) > > foldername - string to specify a foldername to save the output. > > * **imapLMMreport** - It prints the numerical report of [StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) on the MATLAB console. > Usage: **imapLMMreport**([StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) > , varargin) > > > Optional output of the conditional mean/beta > > % a 4d matrix with (Npredictor,beta[95%CI],xSize,ySize) > > betamaps = varargin{1}; > > * **imapLMMposthoc** - Post-hoc contrast on raw/smoothed data (total fixation duration or fixation number), based on significant linear contrast. An interface will allow you to select one or more significant clusters. Notice: mean fixation duration could be computed by total fixation duration./fixation number > Usage: [PostHoc](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) > = **imapLMMposthoc**([StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) > , [FixMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) > , [LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) > , method, flag, formula2) > > > method - 'mean' or 'sum' value in the cluster > > flag - 1 display result (default) > > formula2 - using another LMM formula other than the original model to perform posthoc > > You can find a visual example [here](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI8.html) . results matching "" =================== No results matching "" ====================== --- # Input Matrix · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html#) AA SerifSans WhiteSepiaNight [Input Matrix](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ======================================================================== Input Matrix ------------ ### RawMap Matrix. size -> total number of items × xSize × ySize ### FixMap Matrix. size -> total number of items × xSize × ySize It's the smoothed RawMap ### PredictorM Dataset or table. size -> total number of items × number of predictor. Categorical column must set to nominal ### DescriptvM Dataset or table. size -> total number of items × number of predictor. The first 5 columns should be (in order, with the exact name): FixNum % total fixation number sumFixDur % total fixation duration meanFixDur % mean fixation duration totalPathLength % total length of scan-path meanPathLength % mean length of scan-path The following columns are the conditions (similiar to PredictorM), and subject column (must be the last column) Categorical column must set to nominal ### Mask 2D binary matrix. size -> xSize × ySize Mask==1 are the pixels being modeled. results matching "" =================== No results matching "" ====================== --- # LMMmap · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html#) AA SerifSans WhiteSepiaNight [LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ================================================================== LMMmap ------ LMMmap is the output of _i_Map4 core function **imapLMM**. The fields of LMMmap are nearly identical to the output from [_LinearMixedModel_](http://www.mathworks.com/help/stats/linearmixedmodel-class.html) class. For each modelled pixel, _i_Map4 saves the model criterion, variances explained, error sum of squares, coefficient estimates and their covariance matrix for both fixed and random effects, and the ANOVA results on the LMM. Additional modelling specifications, as well as other model parameters including LMM formula, design matrix for fixed and random effect, and residual degrees of freedom, are also saved in LMMmap. Linear contrasts and other analyses based on variance or covariance can be performed afterwards from the model fitting information. Any other computation on the [_LinearMixedModel_](http://www.mathworks.com/help/stats/linearmixedmodel-class.html) output can also be replicated on LMMmap. For example, the LMMmap in [Example 1](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-1.html) is shown below: % LMMmap = % % runopt: [1x1 struct] % VariableInfo: [6x4 dataset] % Variables: [118x6 dataset] % FitMethod: 'REML' % Formula: [1x1 classreg.regr.LinearMixedFormula] % modelX: [118x6 double] % FitOptions: {'DummyVarCoding' 'effect' 'Fitmethod' 'REML'} % modelDFE: 112 % CoefficientNames: {1x6 cell} % Anova: [1x1 struct] % SinglePred: [1x1 struct] % RandomEffects: [1x1 struct] % CoefficientCovariance: [4-D double] % MSE: [205x256 double] % SSE: [205x256 double] % SST: [205x256 double] % SSR: [205x256 double] % Rsquared: [2x205x256 double] % ModelCriterion: [4x205x256 double] % Coefficients: [4-D double] results matching "" =================== No results matching "" ====================== --- # Example 1 (GUI) · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg1.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg1.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg1.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg1.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg1.html#) AA SerifSans WhiteSepiaNight [Example 1 (GUI)](https://junpenglao.gitbooks.io/imap4_guidebook/content/) =========================================================================== Example 1 (GUI) =============== * [Background of Example 1](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-1.html) * [Using the GUI (1): Import Data and label columns](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI1.html) * [Using the GUI (2): Parameters and Conditions](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI2.html) * [Using the GUI (3): Create smoothed fixation matrix](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI3.html) * [Using the GUI (4): Optional for preprocessing](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI4.html) * [Using the GUI (5): Descriptive Statistics Report](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI5.html) * [Using the GUI (6): Spatial Mapping Using Linear Mixed Models](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI6.html) * [Using the GUI (7): Hypothesis testing and Display results](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI7.html) * [Using the GUI (8): Post-hoc analysis](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI8.html) results matching "" =================== No results matching "" ====================== --- # Using the GUI (1): Import Data and label columns · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI1.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI1.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI1.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI1.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI1.html#) AA SerifSans WhiteSepiaNight [Using the GUI (1): Import Data and label columns](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ============================================================================================================ Using the GUI (1): Import Data and label columns ------------------------------------------------ You can use the GUI to prepare data inputs for Linear Mixed Modeling in _i_Map4. go to folder ./Data\_Sample\_with\_codes/Data\_sample\_DEMO, and click **Create Fixation Matrix** on the Main window to start: ![iMap4 GUI1](http://i.imgur.com/Y0Ww2c5.png) * * * ### Import Data Click **import data** to import one or multiple files. ![iMap4 GUI2](http://i.imgur.com/ieBpsK5.png) 1. One file You can import either text files (.txt) or Matlab files (.mat) 1. Text file (.txt) You need to specify the number of columns and the delimitation of the file. Four delimitations are treated in this version: space, tabulation, comma and semicolon. 2. Matlab file (.mat) There should be only one matrix file within your .mat file 2. Multiple files You can import multiple files having the same number and type of columns. Moreover, all files should be either .txt or .mat but not a mixture of both. _Please note: To be able to proceed to next steps, it is mandatory to have at least Five columns in the file that refer to: Subject, Trial, horizontal fixation location X, vertical fixation location Y and the fixation Duration. Moreover, Trial index should be unique within a subject (i.e., all trails are represented by different number even they are not belonging to the same condition)._ ![iMap4 GUI3](http://i.imgur.com/yaeoJ15.png) When you import one or multiple file(s), a pop-up window will ask you if **Subject** information is included in the selected file(s). If you answer **no**, a pop-up will appear for you to define subject manually. You need to select the files corresponding to the same subject by clicking on checkboxes. * * * ### Check Columns In this step, you can rename the columns and create new predictor from existing predictors. ![iMap4 GUI4](http://i.imgur.com/5BgVu8x.png) Column name could be changed here by manual input. You can also import a [.txt](https://github.com/iBMLab/iMap4/blob/master/Data_Sample_with_codes/Data_sample_DEMO/label.txt) file with one column name on each line. ![iMap4 GUI5](http://i.imgur.com/nqz5NUs.png) ![iMap4 GUI6](http://i.imgur.com/m4wF9aB.png) After clicking **Continue**, a pop-up will appear for creating new predictors ![iMap4 GUI7](http://i.imgur.com/tEaOVCd.png) This is for the cases that user would like to create a categorical predictor from an existing continuous predictor. For example, the following screenshots show how to transfer **Rating** into a categorical predictor **RatingCat**: ![iMap4 GUI8](http://i.imgur.com/g6DPp4F.png) ![iMap4 GUI9](http://i.imgur.com/Zumwt2c.png) ![iMap4 GUI10](http://i.imgur.com/Wy5RuZd.png) ![iMap4 GUI11](http://i.imgur.com/mQZCrbg.png) Now you can proceed to the next step in the GUI: [Parameters/Conditions](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI2.html) results matching "" =================== No results matching "" ====================== --- # Using the GUI (3): Create smoothed fixation matrix · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI3.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI3.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI3.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI3.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI3.html#) AA SerifSans WhiteSepiaNight [Using the GUI (3): Create smoothed fixation matrix](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ============================================================================================================== Using the GUI (3): Create smoothed fixation matrix -------------------------------------------------- ### Smoothing This step produces a 3D smoothed fixation map (number\_of\_item × xSize × ySize). Raw fixation map is smoothed by convolve with a Gaussian Kernel in two ways in _i_Map4: 1. The estimated method - the first dimension coded for each condition in each participant; 2. Single-trial method - the first dimension coded for each single trial. A pop-up will first appear for you to decide the smoothing parameter. _i_Map4 uses a Gaussian Kernel with the full width at half maximum (FWHM) set to 1° visual angle. _i_Map4 will automatically convert the visual angle into pixel value, notice that here in this example we will set it to 20 pixel (i.e., the Smoothing parameter as shown below). ![iMap4 GUI18](http://i.imgur.com/E17hUNe.png) You can click **Generate** on the left to visualize another subject/Trial, or you can change the parameter and click **Validate** to see the smoothing effect. The smoothing will begin when you click on **Done**. Finally, a pop-up will show you the directory where the resulting matrixes have been saved. ![iMap4 GUI19](http://i.imgur.com/QDV0sKg.png) ![iMap4 GUI20](http://i.imgur.com/RaEJRFA.png) Alternatively, you can select the Single-trial method. It is the most appropriate if you have a continuous predictor variating at single-trial level. You will need to perform rescaling first to reduce memory usage and computational time. A pop-up will lead you to perform rescaling. (It’s the same one when you click on **Rescale** in Optional). After that, the procedure will be identical to the estimated method. ![iMap4 GUI21](http://i.imgur.com/hkEDSsD.png) There are a few [optional](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI4.html) preprocessing steps you could apply. Alternatively, you can proceed to [visualized the data](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI5.html) and perform [modeling using Linear Mixed Model](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI6.html) results matching "" =================== No results matching "" ====================== --- # Using the GUI (4): Optional for preprocessing · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI4.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI4.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI4.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI4.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI4.html#) AA SerifSans WhiteSepiaNight [Using the GUI (4): Optional for preprocessing](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ========================================================================================================= Using the GUI (4): Optional for preprocessing --------------------------------------------- ### Optional Optional features include the aforementioned **Rescale**, **Mask** generation and spatial **Normalization** on the fixation map. * * * **Rescale**: Linear downsampling using imresize in Matlab with "nearest" method. ![iMap4 GUI21](http://i.imgur.com/hkEDSsD.png) * * * **Mask**: In _i_Map4, model fitting is only performed within a given mask, as the sparse outliners in 2D fixation map are very likely to generate erroneous estimation. The default threshold is the full width at half maximum (FWHM) for the minimal fixation duration after smoothing. ![iMap4 GUI22](http://i.imgur.com/x2kn1Gj.png) * * * **Normalization** (not shown here) could be done either by performing pixel-wise Z-score or divide by total trial/condition duration. results matching "" =================== No results matching "" ====================== --- # Using the GUI (2): Parameters and Conditions · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI2.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI2.html#) AA SerifSans WhiteSepiaNight [Using the GUI (2): Parameters and Conditions](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ======================================================================================================== Using the GUI (2): Parameters and Conditions -------------------------------------------- ### Parameters You need to specify the following parameters: Screen resolution in your experiment (x and y), in the current example is 1280×1024. The resolution of the presented stimuli during experiment (in pixel), here is also 1280×1024. Screen size in centimeters, in this case 37×30 cm. Participant distance to the screen (83 cm). ![iMap4 GUI12](http://i.imgur.com/uwVGqml.png) The parameters are mandatory to be filled before proceeding. _Please note: the fixation X and Y from your input file should be a relative fixation location in reference with the stimuli. See below as an example._ ![iMap4 GUI13](http://i.imgur.com/S2Z0q7W.png) * * * ### Predictors First specify the columns that refer to Subject, Trial, fixation X, Y and Duration. ![iMap4 GUI14](http://i.imgur.com/UlIi5OG.png) _i_Map4 will then ask for the predictors you would like to include in the modeling (your experiment conditions – fixed effects, and random covariance you would like to control – random effects). The selected variables will be saved in PredictorM.mat as one of the output files. ![iMap4 GUI15](http://i.imgur.com/FbQ8fZ2.png) _Please note: verify carefully whether you would like to treat your predictors as continuous (e.g., subjective rating) or categorical (e.g., gender). By default, the type of predictor is set to categorical if it has less than 5 levels._ A pop-up window will appear for you to specify the fixation map type (the value on the map represents either fixation durations or fixation numbers). Moreover, you could include or exclude specific fixation (e.g., exclude the first fixation). ![iMap4 GUI16](http://i.imgur.com/yrGI9nf.png) ![iMap4 GUI17](http://i.imgur.com/VX0mmLy.png) Now you can proceed to the next step in the GUI: [Smoothing Methods](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI3.html) results matching "" =================== No results matching "" ====================== --- # Using the GUI (5): Descriptive Statistics Report · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI5.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI5.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI5.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI5.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI5.html#) AA SerifSans WhiteSepiaNight [Using the GUI (5): Descriptive Statistics Report](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ============================================================================================================ Using the GUI (5): Descriptive Statistics Report ------------------------------------------------ ### Descriptive Statistics Report Before proceeding to **Linear Mixed Model**, you can get a sense of your dataset by visualizing the descriptive statistics. ![iMap4 GUI23](http://i.imgur.com/zPUv4Xo.png) For each of the categorical condition, _i_Map4 output the mean fixation map for each level. Descriptive statistics for the following eye movement measurements will be plot in a histogram or boxplot: * Number of fixations * Sum of fixation duration (Total viewing time) * Mean fixation duration * Total path length (total eye movement path length in pixel) * Mean path length ![iMap4 GUI24](http://i.imgur.com/h3KZCaL.png) Moreover, you can save the descriptive statistics for all possible combinations of a set of selected conditions. ![iMap4 GUI25](http://i.imgur.com/Ehkmef8.png) The output figures including the following: ![iMap4 GUI26](http://i.imgur.com/lqMSXQq.png) ![iMap4 GUI27](http://i.imgur.com/Q1RJO4E.png) Numeral output and description of the figure could be found in a text file “Info\_\*.txt”. You could find all the saved figure and information under folder ‘./Descriptive\_STAT’ and its subfolders. Further statistical analysis on these eye movement measurements could be performed by loading the DescriptvM matrix. ![iMap4 GUI28](http://i.imgur.com/6VsPyya.png) results matching "" =================== No results matching "" ====================== --- # Other useful features and function · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Other-useful-features-and-function.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Other-useful-features-and-function.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Other-useful-features-and-function.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Other-useful-features-and-function.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Other-useful-features-and-function.html#) AA SerifSans WhiteSepiaNight [Other useful features and function](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ============================================================================================== Other useful features and function ---------------------------------- The following functions could be called as standalone function, we find them quite useful in some occasions. * iMap4\\/imap\_utilities\\/rdmfixmap.m It computes the representational dissimilarity matrix of smoothed fixation map basic on Mahalanobis distance. * iMap4\\/imap\_utilities\\/imsqrmat.m Publication ready figure output of square\\/nearly square matrix. * iMap4\\/imap\_utilities\\/CategoricalName.m It extracts the catigorical predictors from model betas * iMap4\\/imap\_utilities\\/CIforFixed.m It outputs the 95% Confidence intervel map. If bootstrap spatial clustering is applied as statistics it also output bootstrapped 95% CI. * iMap4\\/GUI\\/descriptive\_part.m It outputs the descriptive result. results matching "" =================== No results matching "" ====================== --- # Using the GUI (6): Spatial Mapping Using Linear Mixed Models · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI6.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI6.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI6.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI6.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI6.html#) AA SerifSans WhiteSepiaNight [Using the GUI (6): Spatial Mapping Using Linear Mixed Models](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ======================================================================================================================== Using the GUI (6): Spatial Mapping Using Linear Mixed Models ------------------------------------------------------------ ### Linear Mixed Modelling in _i_Map4 A pop-up will ask for the already saved [FixMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) , [PredictorM](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) , and [Mask](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) after you click on the **Linear Mixed Model**. ![iMap4 GUI29](http://i.imgur.com/RhVdjWx.png) Then you can select your fixed effect (main and/or interaction) and random effect. ![iMap4 GUI30](http://i.imgur.com/rUYehjw.png) The linear formula can be further specified by clicking **Edit Formula**. In the following example the formula for the LMM is _PixelIntensity ~ Spotlight + Position + Spotlight:Position + (fixdur|subject)_ ![iMap4 GUI31](http://i.imgur.com/6HtlWzp.png) If you would like to perform **Linear Contrast** later on, set **singlepredi** to 1. Also if your machine has access to Distributed Computing Servers you could input the cluster name in **parallelname** (_i_Map4 will connect to local cluster by default if your machine equips with parallel toolbox). Moreover, you can specify the option for linear mixed model fitting. The input arguments accept by _i_Map4 is identical to the [_LinearMixedModel_](http://uk.mathworks.com/help/stats/linearmixedmodel-class.html) class in Matlab. For more information please check: [http://www.mathworks.com/help/stats/fitlme.html](http://www.mathworks.com/help/stats/fitlme.html) ![iMap4 GUI32](http://i.imgur.com/LvjI13V.png) * * * To proceed to the modeling, click **Run Model**. A pop-up will prompt you to rename the result for saving when the modeling finishes. Details on parameter estimation please refer to McCulloch, Searle & Neuhaus (2011) and Pinheiro & Bates (2000) as well as the Matlab help documents [http://www.mathworks.com/help/stats/estimating-parameters-in-linear-mixed-effects-models.html](http://www.mathworks.com/help/stats/estimating-parameters-in-linear-mixed-effects-models.html) _Please note: _i_Map4 fits a linear mixed model for each pixel within the mask, and it’s usually a very slow process. Please be patient when this step is running._ ![iMap4 GUI33](http://i.imgur.com/uVoTalH.png) Well, now that _i_Map4 is running, you can go get a cup of tea and check you Facebook ;-) Alternatively, check our [Github page](https://github.com/iBMLab) to see other exciting projects we are currently working on. results matching "" =================== No results matching "" ====================== --- # Background of Example 2 · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-2.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-2.html#) AA SerifSans WhiteSepiaNight [Background of Example 2](https://junpenglao.gitbooks.io/imap4_guidebook/content/) =================================================================================== Background of Example 2 ----------------------- As a second demonstration, we reanalysed the full dataset from one of our previous paper Miellet, S., He, L., Zhou, X., Lao, J. & Caldara, R. (2012). When East meets West: gaze-contingent Blindspots abolish cultural diversity in eye movements for faces. _Journal of Eye Movement Research, 5_(2):[5,1-12.](http://www.jemr.org/online/5/2/5) ![example2-orig](http://i.imgur.com/XzXmk4P.png) _Figure 2 in Miellet et al. (2012)_ Previous studies testing Western Caucasian (WC) and East Asian (EA) observers showed that people deploy different eye movement strategy during free-viewing of faces. Western Caucasian observers fixate systematicly towards the eyes and mouth, following a triangular pattern, whereas East Asian observers perfominatly fixated at the center of the face (Blais, Jack, Scheepers, Fiset, & Caldara, 2008; Caldara, Zhou, & Miellet, 2010). Moreover, human observers can flexibly adjust their eye movment strategy to adapt to the environmental constraints, as shown using different gaze-contingent paradigm (Caldara, Zhou, & Miellet, 2010; Miellet, He, Zhou, Lao, & Caldara, 2012). In our 2012 study, we tested two groups of observers in a face task where their foveal vision were restricted by a blindspot. This is a mixed design with the culture of the observers as the between-subject factor (WCs or EAs) and the blindspot size as the within-subject factor (four level: natural viewing, 2° blindspot, 5° blindspot, or 8° blindspot). For more details of the experiment, please find Miellet, et al (2012). You can find the analysis code [here](https://github.com/iBMLab/iMap4/blob/master/Data_Sample_with_codes/imap_blindspot.m) results matching "" =================== No results matching "" ====================== --- # Example 2 (Code) · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg2.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg2.html#) AA SerifSans WhiteSepiaNight [Example 2 (Code)](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ============================================================================ Example 2 (Code) ================ * [Background of Example 2](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-2.html) * [Analysis using codes: example 2](https://junpenglao.gitbooks.io/imap4_guidebook/content/Analysis-using-codes-example-2.html) results matching "" =================== No results matching "" ====================== --- # Using the GUI (7): Hypothesis testing and Display results · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI7.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI7.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI7.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI7.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI7.html#) AA SerifSans WhiteSepiaNight [Using the GUI (7): Hypothesis testing and Display results](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ===================================================================================================================== Using the GUI (7): Hypothesis testing and Display results --------------------------------------------------------- ### Perform Hypothesis Testings and Result Visualizing in _i_Map4 The following session will show you how to perform hypothesis testings and how to visualize the result. Click **Linear Contrast** and load [LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) and its correspondent [FixMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) to continue. ![iMap4 GUI34](http://i.imgur.com/xZkiV6T.png) ![iMap4 GUI35](http://i.imgur.com/szBB4Gd.png) ![iMap4 GUI36](http://i.imgur.com/BCPqQWS.png) * * * ### Display Model Fitting Click **Model Fitting** to visualize the R2, adjusted-R2, AIC, BIC, Log-Likelihood Ratio and Deviance from the model fitting result. ![iMap4 GUI37](http://i.imgur.com/94zstOY.png) ![iMap4 GUI38](http://i.imgur.com/c1GrtwH.png) ![iMap4 GUI39](http://i.imgur.com/AD4yYGh.png) * * * ### Perform ANOVA for Fixed Effects Click **ANOVA** to perform F-test on the main effect and/or interaction of the fixed effects. The result of parametric test will be displayed first, then followed by multiple comparison correction or non-parametric statistics (currently nested under multiple comparison correction tab). ![iMap4 GUI40](http://i.imgur.com/lIthSTN.png) For multiple comparison correction, many options are included in _i_Map4: FDR, Bonferroni Correction, Random Field Theory, Bootstrap Spatial Clustering and Permutation. Bootstrap Spatial Clustering method is the default option, as its familywise error rate (FWER) has already been validated by our team. You could also perform the multiple comparison correction on the TFCE map instead of the original statistic values (Smith and Nichols, 2009). ![iMap4 GUI41](http://i.imgur.com/nejLplU.png) _Please note: for Bootstrap Spatial Clustering method, if you have a between-subject variable (e.g., gender), you should input it into the bootgroup in the following pop-up window._ ![iMap4 GUI42](http://i.imgur.com/IT30Eju.png) Then wait a few minutes for the resampling to finish... ![iMap4 GUI43](http://i.imgur.com/xoC6oAI.png) Save the result ![iMap4 GUI44](http://i.imgur.com/UHdWxE9.png) ![iMap4 GUI45](http://i.imgur.com/wHnjT9f.png) _Please note: saving could be slow, be patient if it seems nothing happen._ And you can plot the result after control for multiple comparison problem! Below is the new result with a different colormap. As you can see below the result after MCC, many small significant areas are actually false positive (Type I error). ![iMap4 GUI46](http://i.imgur.com/ClVN610.png) The resulting statistic values and masks are in Matlab Structure format: [StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) (before MCC) or [StatMap\_c](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) (after MCC). They are saved in the same directory with [LMMmap](https://junpenglao.gitbooks.io/imap4_guidebook/content/LMMmap.html) , while the figures are saved under a new folder in .eps format. If a background file is included in display option, the same statistic map will be displayed overlaying on top of the background file. ![iMap4 GUI47](http://i.imgur.com/KYqtn0i.png) * * * ### Perform Linear Contrast on Categorical Predictors _Please note: this option do not applied if you set the 'SinglePredi' parameter to 0 in the model fitting. Here the categorical predictors are estimated with a full model only containing categorical conditions. In another word, iMap4 removes all the covariance from continuous predictors in the original model and then fits a full model with all interactions on the categorical conditions. In the example showing here the two models are identical. For more information such as how to perform linear contrast on the original model coefficients, please check the example codes._ Click **Linear Contrast** to proceed. This step is very similar to performing ANOVA. ![iMap4 GUI48](http://i.imgur.com/ImR74Px.png) In the example above, the following linear contrast will perform: H0 ∶ c100_back - cNV_back = h vs. H1 ∶ c100_back - cNV_back ≠ h A pop-up will appear for you to specify the hypothesis (h, usually is 0), p-value threshold (alpha, usually is .05), and the Name of the contrast test. Essentially, linear contrast performs the hypothesis testing of H0 ∶ c × β = h vs. H1 ∶ c × β ≠ h In the example shown above, the c = \[1 0 0 0 -1 0\] and h = \[0\]. If you had selected an unbalance contrast (for example c = \[1 0 0 0 -1 -1\]), _i_Map 4 will balances the contrast vector before continue (change the original c into c1 = \[2 0 0 0 -1 -1\]). ![iMap4 GUI49](http://i.imgur.com/Crkuj2N.png) ![iMap4 GUI50](http://i.imgur.com/snAwAei.png) The result below is the figure output after multiple comparison correction using Bootstrap Clustering as MCC and displayed in another colormap setting. ![iMap4 GUI51](http://i.imgur.com/CAtY3bX.png) You can also perform a one-tail t-test of a single predictor against the “baseline activation” (the mean fixation intensity within the mask). The result will show the significant above chance fixation region. ![iMap4 GUI52](http://i.imgur.com/tlHGiVo.png) ![iMap4 GUI53](http://i.imgur.com/Sb2Q04p.png) ![iMap4 GUI54](http://i.imgur.com/t4mgrYu.png) In all the above cases, you have the option to visualize the distribution of the statistical value by putting “1” in the relevant display option. ![iMap4 GUI55](http://i.imgur.com/ki1M6SN.png) * * * ### Display Saved StatMap or StatMap\_c Once the [StatMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) or [StatMap\_c](https://junpenglao.gitbooks.io/imap4_guidebook/content/StatMap,-Posthoc-and-figure-outputs.html) has been saved, you can visualize it again by loading them directly. Select **StatMap** from below: ![iMap4 GUI56](http://i.imgur.com/5EBDWCN.png) or select **Display Results** from below: ![iMap4 GUI57](http://i.imgur.com/Vgybohl.png) results matching "" =================== No results matching "" ====================== --- # References · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/References.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/References.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/References.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/References.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/References.html#) AA SerifSans WhiteSepiaNight [References](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ====================================================================== References ---------- Baayen, R. H., Davidson, D. J., & Bates, D. M. (2008). Mixed-effects modeling with crossed random effects for subjects and items. _Journal of memory and language, 59_(4), 390-412. Bolker, B. M., Brooks, M. E., Clark, C. J., Geange, S. W., Poulsen, J. R., Stevens, M. H. H., & White, J.-S. S. (2009). Generalized linear mixed models: a practical guide for ecology and evolution. _Trends in ecology & evolution, 24_(3), 127-135. Caldara, R., & Miellet, S. (2011). iMap: A Novel Method for Statistical Fixation Mapping of Eye Movement data, _Behavior Research Methods, 43_(3), 864-78 Christensen, R. (2011). _Plane Answers to Complex Questions: The Theory of Linear Models_. Springer. McCulloch, C. E., Searle, S. R., & Neuhaus, J. M. (2011). _Generalized, Linear, and Mixed Models_. Wiley. Miellet, S., Lao, J., & Caldara, R. (2014). An appropriate use of iMap produces correct statistical results: a reply to McManus (2013) iMAP and iMAP2 produce erroneous statistical maps of eye-movement differences. _Perception, 43_, 451-457. Pinheiro, J. C., & Bates, D. M. (2000). _Mixed-Effects Models in S and S-PLUS_. Springer. Raudenbush, S. W., & Bryk, A. S. (2002). _Hierarchical Linear Models: Applications and Data Analysis Methods_. SAGE Publications. Smith S.M., & Nichols, T.E. (2009). Threshold-free cluster enhancement: addressing problems of smoothing, threshold dependence and localisation in cluster inference. _Neuroimage, 44_(1), 83-98 Winkler, A. M., Ridgway, G. R., Webster, M. A., Smith, S. M., & Nichols, T. E. (2014). Permutation inference for the general linear model. _Neuroimage, 92_, 381-397. results matching "" =================== No results matching "" ====================== --- # Future development · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Future-development.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Future-development.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Future-development.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Future-development.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Future-development.html#) AA SerifSans WhiteSepiaNight [Future development](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ============================================================================== Future development ================== The following features are part of _i_Map 4 but have not been implemented in the GUI yet: * The display of random-effects coefficients * The bootstrap confidence interval of the fixed coefficients * A robust option by Winsorization of the single-trial FixMap. The following features are still under development: * Random-effects related statistics. * Model comparison of multiple fitted models results matching "" =================== No results matching "" ====================== --- # Background of Example 1 · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-1.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-1.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-1.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-1.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Background-of-Example-1.html#) AA SerifSans WhiteSepiaNight [Background of Example 1](https://junpenglao.gitbooks.io/imap4_guidebook/content/) =================================================================================== Background of Example 1 ----------------------- The following example is based on a subset of participants from Bovet, J., Lao, J., Bartholomée, O., Caldara, R., & Raymond, M. (2016). Mapping female bodily features of attractiveness. Scientific Reports, 6, _18551_.[doi: 10.1038/srep18551](http://www.nature.com/articles/srep18551) In short, the example dataset consists of eye movement data from twenty male observers during a gaze-contingent study. Observers viewed computer rendered female bodies in different conditions and performed a behavioral task (i.e., subjective rating of bodily attractiveness). This is a within-subject design with two experimental manipulations: the viewing condition (three level: 2° spotlight, 4° spotlight, or natural viewing) and body orientation (two level: front view or back view). The aim of the study is to evaluate the visual information use for bodily attractiveness evaluation in the male observers. Other details of the experiment can be found in the paper. ![paper fig1](http://www.nature.com/article-assets/npg/srep/2016/160121/srep18551/images_hires/w926/srep18551-f3.jpg) ![paper fig2](http://www.nature.com/article-assets/npg/srep/2016/160121/srep18551/images_hires/w926/srep18551-f4.jpg) Fixation durations were projected into the two-dimensional space according to their coordinates at the single-trial level. Fixation duration maps were first smoothed at 1° of visual angle. We used the “estimated” option by taking the expected values across trial within the same condition independently for each observer. To reduce the computational time, we down-sampled the fixation map to 256\*205 pixels, and applied a mask to only model the pixels with average duration larger than half of the minimum fixation duration input. You can follow the step to perform the analysis using the GUI, or run the analysis code [here](https://github.com/iBMLab/iMap4/blob/master/Data_Sample_with_codes/imap_DEMO.m) results matching "" =================== No results matching "" ====================== --- # Additional information · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_addi.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_addi.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_addi.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_addi.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_addi.html#) AA SerifSans WhiteSepiaNight [Additional information](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ================================================================================== Additional information ====================== * [References](https://junpenglao.gitbooks.io/imap4_guidebook/content/References.html) * [Credit and other information](https://junpenglao.gitbooks.io/imap4_guidebook/content/Credit-and-other-information.html) results matching "" =================== No results matching "" ====================== --- # Example 3 - Simulation Study A · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Example-3---Simulation-Study-A.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Example-3---Simulation-Study-A.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Example-3---Simulation-Study-A.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Example-3---Simulation-Study-A.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Example-3---Simulation-Study-A.html#) AA SerifSans WhiteSepiaNight [Example 3 - Simulation Study A](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ========================================================================================== Example 3 - Simulation Study A ============================== The following code is a demonstration of the Single-Trial estimation method for _i_Map4. A computer simulated data set is introduced here: a 4 x 4 grid was presented to 20 subjects for 100 trials, each trial participant gives a subjective rating (from -3 to 3 in the current case). We simulate a linear relationship between rating and fixation number on each grid with different power. _i_Map4 will then used to estimate the relationship for each grid. %% create linear relationship sample - one subject p=userpath; addpath(genpath([ p(1:end-1) '/Apps/iMAP'])); rng('default'); % For reproducibility rng(1) rho=[.9,.6,.3,0]; slope=[1,.4,-.2,-.8]; n = 100;% N trials iplot=0; mu1=[0 0]; Sigma1=[1 0; 0 1]; R1=chol(Sigma1); Z1 = repmat(mu1,n,1) + randn(n,2)*R1; X=Z1(:,1); figure; for irr=1:length(rho) for iss=1:length(slope) % Gaussian copula % mu=[0 0]; Sigma=[1 rho(irr); rho(irr) 1]; % Z = mvnrnd(mu,Sigma,n); % U = normcdf(Z,0,1); R=chol(Sigma); Z1(:,2)=randn(n,1); U = Z1*R; iplot=iplot+1; subplot(4,4,iplot);hold on % introduce slope U(:,2)=U(:,2).*slope(iss); % normalized constant=min(U(:,2)); cst=constant*sign(constant); U(:,2)=U(:,2)+cst; plot(X,U(:,2),'.k'); plot(X,X.*slope(iss)+cst,'r') title(['Y_' num2str(iplot) '=' num2str(slope(iss)) '*X+c_' num2str(iplot) '; (rho_' num2str(iplot) '=' num2str(rho(irr)) ')']); axis([-2.2 2.2 0 5.5]) end end xlabel('Rating'); ylabel('Response'); 16 different linear relationship is introduced on a 4 by 4 grid: ![example3-1](http://i.imgur.com/5wUoXkG.png) The x-axis shows the Z-scored rating and the y-axis shows the expected number of fixations. The slope between y and x are the same within each column (\[1, 0.4, -0.2, -0.8\] respectively), while the correlation rho is the same within each row (\[0.9, 0.6, 0.3, 0\] respectively). Postive slope indicates rating and fixation number is postively correlated on that location, vice versa. We then generate the Single-trial Rating response for all the subject (matrix **Xall**) and the location specify relationship (matrix **Yall**) %% create data sample - all subject figure; Ns= 20;% Ns subjects mu1=[0 0]; Sigma1=[1 0; 0 1]; R1=chol(Sigma1); Xall=zeros(Ns,100); Yall=zeros(Ns,length(rho)*length(slope),100); for is=1:Ns rng(is) Z1 = repmat(mu1,n,1) + randn(n,2)*R1; Xall(is,:)=Z1(:,1); itype=0; for irr=1:length(rho) for iss=1:length(slope) itype=itype+1; % Gaussian copula Sigma=[1 rho(irr); rho(irr) 1]; R=chol(Sigma); Z1(:,2)=randn(n,1); U = Z1*R; % introduce slope U(:,2)=U(:,2).*slope(iss); % normalized constant=min(U(:,2)); cst=constant*sign(constant); U(:,2)=U(:,2)+cst; Yall(is,itype,:)=U(:,2); if itype==1 plot(Xall(is,:),squeeze(Yall(is,1,:)),'.') hold on end end end end We generate fixation matrix according to the design matrix using a Gaussian mixture model, here is the example of one subject one trial: figure; ip=0; xSize=150; ySize=150; for iy=1:4 for ix=1:4 ip=ip+1; muG(ip,:)=[ix*30,iy*30]; end end sigma = [10 0; 0 10]; p = squeeze(Yall(1,:,7));% the mixing parameter for GMM Nfix=60; muG2=muG; muG2(p==0,:)=[]; p(p==0)=[]; obj = gmdistribution(muG2,sigma,p); subplot(1,3,1) ezsurf(@(x,y)pdf(obj,[x y]),[0 xSize],[0 ySize]) zlim([0,10]) subplot(1,3,2) rng(1); % For reproducibility Nfix=60; % total number of fixation Y = random(obj,Nfix); plot(Y(:,1),Y(:,2),'o') set(gca,'YDir','reverse'); axis([0 xSize 0 ySize],'square') % smooth map smoothingpic=5; [x, y] = meshgrid(-floor(ySize/2)+.5:floor(ySize/2)-.5, -floor(xSize/2)+.5:floor(xSize/2)-.5); gaussienne = exp(- (x .^2 / smoothingpic ^2) - (y .^2 / smoothingpic ^2)); gaussienne = (gaussienne - min(gaussienne(:))) / (max(gaussienne(:)) - min(gaussienne(:))); f_fil = fft2(gaussienne); % fixation matrix coordX = round(Y(:,2)); coordY = round(Y(:,1)); indx1=coordX>0 & coordY>0 & coordX0 & coordY>0 & coordX.25); % figure;imagesc(Mask) PredictorM=dataset(Rating,fixNb,Subject); ds=mat2dataset(DataM); ds=set(ds,'VarNames',{'fixN','rl','cl','rating','is'}); export(ds,'File','STrate.csv','Delimiter',','); Using the core functions to fit a linear mixed model and perform statistics: %% Linear Mixed Modeling with imapLMM tic opt.singlepredi=0; [LMMmap,lmexample]=imapLMM(FixMap,PredictorM,Mask,opt, ... 'PixelIntensity ~ Rating + (1|Subject)', ... 'DummyVarCoding','effect','FitMethod','REML'); toc %% show result %% plot model fitting close all opt1.type='model'; % perform contrast [StatMap]=imapLMMcontrast(LMMmap,opt1); % output figure; imapLMMdisplay(StatMap,0); %% plot fixed effec(anova and beta) % close all opt=struct;% clear structure opt.type='model beta'; opt.alpha=.05; % perform contrast [StatMap]=imapLMMcontrast(LMMmap,opt); % imapLMMdisplay(StatMap,1) mccopt=struct; mccopt.methods='bootstrap'; mccopt.nboot=1000; mccopt.bootopt=1; mccopt.tfce=0; % perform multiple comparison correction [StatMap_c]=imapLMMmcc(StatMap,LMMmap,mccopt,FixMap); % output figure; imapLMMdisplay(StatMap_c,0) The significant regression coefficients of Rating are shown below. _i_Map4 accurately rejected the null hypothesis for most conditions when there was a significant relationship. For the most robust effect (r= 0.9), _i_Map4 accurately estimated the coefficients. It also correctly reported null result for r = 0. Moreover, _i_Map4 did not report any significant effect for the weakest relationship (slope = -0.2, r = 0.3) due to the lack of power. ![example3-3](http://i.imgur.com/l5wXMk7.png) c) The average fixation map across all trial for the 20 subjects. d) Estimated relationship between rating and fixation number (regression coefficient). The black circles indicate statistical significance. You can find the simulation code [here](https://github.com/iBMLab/iMap4/blob/master/Data_Sample_with_codes/imap_DEMO_ST1.m) with some additional information. results matching "" =================== No results matching "" ====================== --- # Analysis using codes: example 2 · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Analysis-using-codes-example-2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Analysis-using-codes-example-2.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Analysis-using-codes-example-2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Analysis-using-codes-example-2.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Analysis-using-codes-example-2.html#) AA SerifSans WhiteSepiaNight [Analysis using codes: example 2](https://junpenglao.gitbooks.io/imap4_guidebook/content/) =========================================================================================== Analysis using codes: example 2 ------------------------------- Using _i_Map4, we created the single-trial 2D fixation duration map and smoothed at 1° of visual angle. Importantly, to keep in line with Miellet, et al (2012), spatial normalization was performed by Z-scoring the fixation map across all pixels independently for each trial (the result is identical without spatial normalization in this example). We also applied a mask generated with the default option. %% Load data clear all clc cd ('Data_sample_blindspot') filename = dir('data*.mat'); % create condition table sbj = repmat([1:30],1,4)'; group = repmat([ones(1,15) ones(1,15)*2],1,4)'; blinkspot = repmat(1:4,30,1); blinkspot = blinkspot(:); Tbl = dataset(sbj,group,blinkspot); % deg0cau = 1:15; % deg0as = 16:30; % deg2cau = 31:45; % deg2as = 46:60; % deg5cau = 61:75; % deg5as = 76:90; % deg8cau = 91:105; % deg8as = 106:120; % parameters for smoothing ySize = 382; xSize = 390; smoothingpic = 10; [x, y] = meshgrid(-floor(xSize/2)+.5:floor(xSize/2)-.5, -floor(ySize/2)+.5:floor(ySize/2)-.5); gaussienne = exp(- (x .^2 / smoothingpic ^2) - (y .^2 / smoothingpic ^2)); gaussienne = (gaussienne - min(gaussienne(:))) / (max(gaussienne(:)) - min(gaussienne(:))); % f_fil = fft2(gaussienne); Nitem = length(filename); rawmapMat = zeros(Nitem, ySize, xSize); fixmapMat = zeros(Nitem, ySize, xSize); stDur = zeros(Nitem,1); Ntall = zeros(Nitem,1); for item = 1:Nitem load(['data' num2str(item) '.mat']) Nfix = size(summary, 1); Trials = unique(summary(:, 4)); Ntall(item) = length(Trials); % condition based coordX = round(summary(:, 2));%switch matrix coordinate here coordY = round(summary(:, 1)); intv = summary(:, 3); indx1 = coordX>0 & coordY>0 & coordX.0045; imagesc(masktmpST);axis('equal','off') We then applied a full model on the single-trial fixation duration map made used of the “single-trial” option in _i_Map4: Pixel_Intensity ~ Observer culture + Blindspot size + Observer culture * Blindspot size + (1 | subject) Only the predictor of subject was treated as random effects and the model was fitted with maximum likelihood estimation (ML). %% imapLMM tic opt.singlepredi=1; [LMMmap,lmexample]=imapLMM(fixmapMatST,TblST,masktmpST,opt, ... 'PixelIntensity ~ groupST + blinkspotST + groupST:blinkspotST + (1|sbjST)', ... 'DummyVarCoding','effect'); toc First check the model fitting parameters: %% plot model fitting close all opt1.type='model'; % perform contrast [StatMap]=imapLMMcontrast(LMMmap,opt1); % output figure; imapLMMdisplay(StatMap,0) After model fitting, we perform ANOVA to test the two main effects and their interactions. The code block below applied a bootstrap clustering test using cluster dense as criteria with 1000 resampling. We found a significant interaction and the main effect of Blindspot size, but not the main effect of culture (See Figure\_a below). %% plot fixed effec(anova result) % close all opt=struct;% clear structure mccopt=struct; opt.type='fixed'; opt.alpha=.05; mccopt.methods='bootstrap'; mccopt.bootgroup={'groupST'}; % mccopt.methods='FDR'; mccopt.nboot=1000; % mccopt.permute=1; mccopt.bootopt=1; % mccopt.sigma=smoothingpic*scale; mccopt.tfce=0; % perform contrast [StatMap]=imapLMMcontrast(LMMmap,opt); % mulitple comparison correction [StatMap_c]=imapLMMmcc(StatMap,LMMmap,mccopt,fixmapMatST); % output figure; imapLMMdisplay(StatMap_c,1) Moreover, by performing linear contrast of the model coefficients, we reproduced the figure 2 as in Miellet, et al (2012). (See Figure\_b below) %% Compute linear contrast (reproduce figure 2 as in the orignial paper) % close all opt=struct;% clear structure mccopt=opt; opt.type='predictor beta'; opt.alpha=.05; opt.c={[-1 0 0 0 1 0 0 0]; ... [0 -1 0 0 0 1 0 0]; ... [0 0 -1 0 0 0 1 0]; ... [0 0 0 -1 0 0 0 1]; ... [1 0 0 -1 0 0 0 0]; ... [0 0 0 0 1 0 0 -1]}; opt.name={'WC-EA NV';'WC-EA 2dg';'WC-EA 5dg';'WC-EA 8dg';'WC NV-8dg'; 'EA NV-8dg'}; % opt.c=limo_OrthogContrasts([3,2]); % opt.name={'Spotlight';'Position';'Interaction'}; % opt.h={[0.005],[0.005],[0.005],[0.005],[0.005],[0.005]}; % opt.onetail='>'; % mccopt.methods='Randomfield'; mccopt.methods='bootstrap'; mccopt.bootgroup={'groupST'}; % mccopt.methods='FDR'; mccopt.nboot=1000; % mccopt.permute=1; mccopt.bootopt=1; % mccopt.sigma=smoothingpic*scale; mccopt.tfce=0; % perform contrast [StatMap]=imapLMMcontrast(LMMmap,opt); [StatMap_c]=imapLMMmcc(StatMap,LMMmap,mccopt,fixmapMatST); % output figure; imapLMMdisplay(StatMap_c,1) For each unique categorical condition, we can compute an "above chance" fixation pattern map. %% Single predictor (above chance fixate) opt=struct;% clear structure mccopt=opt; opt.type='predictor beta'; opt.alpha=.05; opt.c={[1 0 0 0 0 0 0 0]; ... [0 1 0 0 0 0 0 0]; ... [0 0 1 0 0 0 0 0]; ... [0 0 0 1 0 0 0 0]; ... [0 0 0 0 1 0 0 0]; ... [0 0 0 0 0 1 0 0]; ... [0 0 0 0 0 0 1 0]; ... [0 0 0 0 0 0 0 1]}; opt.name={'EA-NV'; ... 'EA-2deg'; ... 'EA-5deg'; ... 'EA-8deg'; ... 'WC-NV'; ... 'WC-2deg'; ... 'WC-5deg'; ... 'WC-8deg'}; h0=mean(fixmapMatST(repmat(masktmpST,[size(fixmapMatST,1),1,1])==1)); opt.h={h0,h0,h0,h0,h0,h0,h0,h0}; % opt.c=limo_OrthogContrasts([3,2]); % opt.name={'Spotlight';'Position';'Interaction'}; % opt.h={[0.005],[0.005],[0.005],[0.005],[0.005],[0.005]}; opt.onetail='>'; % mccopt.methods='Randomfield'; mccopt.methods='bootstrap'; mccopt.bootgroup={'groupST'}; % mccopt.methods='FDR'; mccopt.nboot=1000; % mccopt.permute=1; mccopt.bootopt=1; % mccopt.sigma=smoothingpic*scale; mccopt.tfce=0; % perform contrast [StatMap]=imapLMMcontrast(LMMmap,opt); [StatMap_c]=imapLMMmcc(StatMap,LMMmap,mccopt,fixmapMatST); % output figure; imapLMMdisplay(StatMap_c,1,[],'parula') The result using _i_Map4: ![example2](http://i.imgur.com/BCLJmtC.png) _i_Map4 results of Miellet et al. (2012). a) ANOVA result of the linear mixed model. b) Replication of figure 2 in Miellet et al. (2012) using linear contrast of the model coefficients. The solid black line circles the significant region for all the above figures. As comparison, the original figure 2 in Miellet et al. (2012): ![example2-orig](http://i.imgur.com/XzXmk4P.png) You can find the analysis code [here](https://github.com/iBMLab/iMap4/blob/master/Data_Sample_with_codes/imap_blindspot.m) results matching "" =================== No results matching "" ====================== --- # Using the GUI (8): Post-hoc analysis · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI8.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI8.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI8.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI8.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Using-the-GUI8.html#) AA SerifSans WhiteSepiaNight [Using the GUI (8): Post-hoc analysis](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ================================================================================================ Using the GUI (8): Post-hoc analysis ------------------------------------ ### Post-hoc Analysis in Significant Cluster(s) Here we show how to perform a post-hoc analysis in a significant cluster. After performing ANOVA or linear contrast, one or more masks will be generated. You can then perform post-hoc in these masks (similar idea as the Region or Area of interested). A post-hoc analysis is applicable if any interaction presented, or any condition contains multiple levels. You can select one or more significant area(s) as data-driven ROI(s) for the post-hoc. If you are using the GUI, click on **Post-Hoc**. Then selected the correspondent [RawMap](https://junpenglao.gitbooks.io/imap4_guidebook/content/Input-Matrix.html) : ![iMap4 GUI58](http://i.imgur.com/ORXu3p9.png) _Please note: in the GUI you should perform this step right after _ANOVA_ or _Linear Contrast_._ or simply: >> [PostHoc] = imapLMMposthoc(StatMap_c,RawMap,LMMmap,'mean'); A pop-up will appear for you to select the region. You can select multiple regions and press “Enter” when finish. You can also press “Enter” without selecting anything to skip a mask. Student t-tests of the raw fixation value for all possible pair comparison of the categorical predictors within the mask will be performed. ![iMap4 GUI59](http://i.imgur.com/WRFR3rV.png) ![iMap4 GUI60](http://i.imgur.com/qU1B90y.png) Significant contrast is shown in the last matrix. results matching "" =================== No results matching "" ====================== --- # Credit and other information · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Credit-and-other-information.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Credit-and-other-information.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Credit-and-other-information.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Credit-and-other-information.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Credit-and-other-information.html#) AA SerifSans WhiteSepiaNight [Credit and other information](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ======================================================================================== Credit and other information ---------------------------- _i_Map4 ![](https://raw.githubusercontent.com/iBMLab/iMap4/master/GUI/IMAP.png) ![](https://raw.githubusercontent.com/iBMLab/iMap4/master/GUI/logo_imap.png) ============================================================================================================================================================ [![Join the chat at https://gitter.im/iBMLab/iMap4](https://badges.gitter.im/iBMLab/iMap4.svg)](https://gitter.im/iBMLab/iMap4?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![GitHub release](https://img.shields.io/badge/release-v1.0-blue.svg)](https://github.com/iBMLab/iMap4/releases/download/v1.0/iMap4.mlappinstall) Installation ------------ Download [iMap4.mlappinstall](https://github.com/iBMLab/iMap4/releases/download/v1.0/iMap4.mlappinstall) and intall the toolbox as a Matlab Application. Example codes and dataset could be found in ./Data\_Sample\_with\_codes/ Please read the [wiki](https://junpenglao.gitbooks.io/imap4_guidebook/content/) for more information of how to use the toolbox. Citing _i_Map4 -------------- Lao, J., Miellet, S., Pernet, C., Sokhn, N., & Caldara, R. (2016). _i_Map4: An Open Source Toolbox for the Statistical Fixation Mapping of Eye Movement data with Linear Mixed Modeling. _Behavior Research Methods._ [doi: 10.3758/s13428-016-0737-x](http://link.springer.com/article/10.3758/s13428-016-0737-x) Published papers using _i_Map4 (Updated manually) ------------------------------------------------- Bovet, J., Lao, J., Bartholomée, O., Caldara, R., & Raymond, M. (2016). Mapping female bodily features of attractiveness. _Scientific Reports, 6_, 18551. [doi: 10.1038/srep18551](http://www.nature.com/articles/srep18551) > We provide a subset of the data from this study as a demo of _i_Map4, see [wiki](https://junpenglao.gitbooks.io/imap4_guidebook/content/readme_eg1.html) Kuchinke, L., Dickmann, F., Edler, D., Bordewieck, M., & Bestgen, A. K. (2016). The processing and integration of map elements during a recognition memory task is mirrored in eye-movement patterns. _Journal of Environmental Psychology, 47_, 213-222. [doi:10.1016/j.jenvp.2016.07.002](http://www.sciencedirect.com/science/article/pii/S0272494416300639) Geangu, E., Ichikawa, H., Lao, J., Kanazawa, S., Yamaguchi, M., Caldara, R., & Turati, C. (2016). Culture shapes 7-month-olds' perceptual strategies in discriminating facial expressions of emotion. _Current Biology, 26_(14), 663-664. [doi:10.1016/j.cub.2016.05.072](http://www.sciencedirect.com/science/article/pii/S0960982216306054) Keep in touch! -------------- Updates and new release will be announced on our \[lab website\] ([http://perso.unifr.ch/roberto.caldara/index.php?page=3).Subscribe](http://perso.unifr.ch/roberto.caldara/index.php?page=3).Subscribe) by following the link and we'll keep you informed!! If you have any question, please email Junpeng.lao@unifr.ch ##### Acknowledgments The development of this toolbox was supported by the Swiss National Science Foundation (n° 100014\_138627) awarded to Dr. Roberto Caldara results matching "" =================== No results matching "" ====================== --- # Example 4 - Simulation Study B · iMap4 User Guidebook [Powered by **GitBook**](https://www.gitbook.com/?utm_source=public_site_legacy&utm_medium=referral&utm_campaign=trademark&utm_term=junpenglao&utm_content=powered_by) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Example-4---Simulation-Study-B.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Example-4---Simulation-Study-B.html#) FacebookGoogle+TwitterWeiboInstapaper [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Example-4---Simulation-Study-B.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Example-4---Simulation-Study-B.html#) [](https://junpenglao.gitbooks.io/imap4_guidebook/content/Example-4---Simulation-Study-B.html#) AA SerifSans WhiteSepiaNight [Example 4 - Simulation Study B](https://junpenglao.gitbooks.io/imap4_guidebook/content/) ========================================================================================== Example 4 - Simulation Study B ============================== In this hypothetical experiment, two groups of subjects participated in a free viewing experiment of face recognition. We introduced a main effect between groups that control subject display a triangle pattern whereas the patient group only look at the month. However, there is an effect of the eye region for the patient group only: if they fixated on the eye they gave more accurate response (Interaction between group and accuracy). We used Gaussian mixture model in Matlab for 2D data generation: %% Generate dataset - GMM clear all;clc; p=userpath; addpath(genpath([ p(1:end-1) '/Apps/iMAP'])); nsamp=10000; % save current random generation state defaultStream = RandStream.getGlobalStream(); savedState = defaultStream.State; % use the Multiplicative Lagged Fibonacci algotrithm for independent substreams mystream = RandStream.create('mlfg6331_64','NumStreams',nsamp,'StreamIndices',1); RandStream.setGlobalStream(mystream); reset(defaultStream); % allows restarting allays the same xSize=100; ySize=100; muG=[40,55;60,55;50,30;50,48]; sigma(:,:,1) = [35 0; 0 30]; sigma(:,:,2) = [35 0; 0 30]; sigma(:,:,3) = [50 0; 0 60]; sigma(:,:,4) = [35 0; 0 60]; p = [30,30,50,10];% the mixing parameter for GMM obj = gmdistribution(muG,sigma,p); subplot(1,3,1) ezsurf(@(x,y)pdf(obj,[x y]),[0 xSize],[0 ySize]) zlim([0,10]) subplot(1,3,2) Nfix=10; % total number of fixation Y = random(obj,Nfix); plot(Y(:,1),Y(:,2),'o') axis([0 xSize 0 ySize],'square') % % smooth map smoothingpic=5; [x, y] = meshgrid(-floor(ySize/2)+.5:floor(ySize/2)-.5, -floor(xSize/2)+.5:floor(xSize/2)-.5); gaussienne = exp(- (x .^2 / smoothingpic ^2) - (y .^2 / smoothingpic ^2)); gaussienne = (gaussienne - min(gaussienne(:))) / (max(gaussienne(:)) - min(gaussienne(:))); f_fil = fft2(gaussienne); % fixation matrix coordX = round(Y(:,2)); coordY = round(Y(:,1)); intv=normrnd(0.4,.085,length(Y),1); indx1=coordX>0 & coordY>0 & coordX.6)+1;% 1 correct, 2 incorrect else ACC=(rand(1,Ntrial)>.4)+1;% 1 correct, 2 incorrect end % ACC=(rand(1,Ntrial)>.5)+1;% 1 correct, 2 incorrect ACCtmp=rand(size(ACC)); [a,b]=sort(ACC); ACC2=zeros(size(ACC)); ACC2(b)=1-sort(ACCtmp); for it=1:Ntrial itt=itt+1; Nfix=ceil(normrnd(MeanNfix,stdNfix)); % total number of fixation if ig==2 if ACC(it)==1; obj=obj1; else obj=obj2; Nfix=ceil(normrnd(MeanNfix*.78,stdNfix)); % total number of fixation end end Ytmp = random(obj,Nfix); Ytmp2= [randi(xSize,2,1) randi(ySize,2,1)]; Y=[Ytmp;Ytmp2]; hold on plot(Y(:,1),Y(:,2),'.','color',[0 0 0]) drawnow axis([0 xSize 0 ySize],'square','off') currFrame = getframe; writeVideo(vidObj,currFrame); rawmap = zeros(ySize, xSize); coordX = xSize-round(Y(:,2)); coordY = round(Y(:,1)); pathlength=diag(squareform(pdist([coordY,coordX])),1); intv=normrnd(Meandur,Stddur,length(Y),1)*1000; indx1=coordX>0 & coordY>0 & coordX.1; %% save matrix save(strcat('./FixMap_single_trial_scaled'),'FixMap','-v7.3'); save(strcat('./PredictorM_single_trial'),'PredictorM','-v7.3'); save(strcat('./DescriptvM_single_trial'),'DescriptvM','-v7.3'); save(strcat('./RawMap_single_trial_scaled'),'RawMap','-v7.3'); save(strcat('./Mask_single_trial_scaled'),'Mask','-v7.3'); Descriptive result can be display quite easily: descriptive_part(DescriptvM,FixMap) Running the core functions for model fitting and hypothesis testing: %% LMM tic opt.singlepredi=1; [LMMmap,lmexample]=imapLMM(FixMap,PredictorM,Mask,opt,'PixelIntensity ~ Grp * ACC + (1|Sbj)','DummyVarCoding','effect'); save('LMMmap_ACC.mat','LMMmap','-v7.3'); toc %% plot model fitting opt1.type='model'; % perform contrast [StatMap]=imapLMMcontrast(LMMmap,opt1); % output figure; imapLMMdisplay(StatMap,0) %% plot fixed effec(anova result using the cell mean DS and its related contrast) % close all opt=struct;% clear structure opt.type='predictor beta'; opt.c=limo_OrthogContrasts([2,2]); opt.name={'Grp','ACC','Interaction'}; opt.alpha=.05; % perform contrast [StatMap]=imapLMMcontrast(LMMmap,opt); imapLMMdisplay(StatMap,0); mccopt=struct; mccopt.methods='bootstrap'; mccopt.bootopt=1; mccopt.bootgroup={'Grp'}; mccopt.nboot=1000; % [StatMap_c]=imapLMMmcc(StatMap,LMMmap,mccopt,FixMap); imapLMMdisplay(StatMap_c,0); %% post-hoc [Posthoc]=imapLMMposthoc(StatMap_c,RawMap,LMMmap,'mean') And we can replace one of the catigorical predictor to a continous predictor while maintaining the same linear relationship (_ACC2_ in this case, see above). The model fitting result is highly similar: %% LMM 2 tic opt.singlepredi=1; [LMMmap2,lmexample]=imapLMM(FixMap,PredictorM,Mask,opt,'PixelIntensity ~ Grp * ACC2 + (1|Sbj)','DummyVarCoding','effect'); save('LMMmap_ACC2.mat','LMMmap2','-v7.3'); toc %% plot model fitting opt1.type='model'; % perform contrast [StatMap]=imapLMMcontrast(LMMmap2,opt1); % output figure; imapLMMdisplay(StatMap,0) %% plot fixed effec(anova result using the cell mean DS and its related contrast) close all opt=struct;% clear structure opt.type='fixed'; % perform contrast [StatMap]=imapLMMcontrast(LMMmap2,opt); imapLMMdisplay(StatMap,0); mccopt=struct; mccopt.methods='bootstrap'; mccopt.bootopt=1; mccopt.bootgroup={'Grp'}; mccopt.nboot=1000; % [StatMap_c]=imapLMMmcc(StatMap,LMMmap2,mccopt,FixMap); imapLMMdisplay(StatMap_c,0); %% opt=struct;% clear structure opt.type='model beta'; % perform contrast [StatMap]=imapLMMcontrast(LMMmap2,opt); imapLMMdisplay(StatMap,0); mccopt=struct; mccopt.methods='bootstrap'; mccopt.bootopt=1; mccopt.bootgroup={'Grp'}; mccopt.nboot=1000; % [StatMap_c]=imapLMMmcc(StatMap,LMMmap2,mccopt,FixMap); imapLMMdisplay(StatMap_c,0); You can find the simulation code [here](https://github.com/iBMLab/iMap4/blob/master/Data_Sample_with_codes/imap_DEMO_ST2.m) results matching "" =================== No results matching "" ====================== --- # Page Not Found · GitBook (Legacy) Page not found Sorry, but the page you were looking for could not be found. [Return to content](https://junpenglao.gitbooks.io/imap4_guidebook/content/) [](https://www.gitbook.com/) --- # Page Not Found · GitBook (Legacy) Page not found Sorry, but the page you were looking for could not be found. [Return to content](https://junpenglao.gitbooks.io/imap4_guidebook/content/) [](https://www.gitbook.com/) ---