This is a collaborative space. In order to contribute, send an email to maximilien.chaumon@icm-institute.org
On any page, type the letter L on your keyboard to add a "Label" to the page, which will make search easier.

Muliple comparisons


Cluser based permutation is used to compute significance probabilities using non-parametric statistical tests. More precisely, cluster based permutations (see Fieldtrip for more details) are used to correct for multiple comparisons after computing F or t statistic.

The input files are in .LENA

The output files (F/t and corrected p values for every main effect and interaction) are in .LENA format.

How to install it ?

The package is located in: /usr/global/matlab/mega_toolbox

  • Launch Matlab from your home directory (ex: _/lena13/home_users/users/dupont_)
  • Under the File menu, go to 'Set Path '
  • In the dialog window, click on 'Add with Subfolders'
  • Browse the directories in order to go to /usr/cenir/matlab
  • Highlight the mega_toolbox directory in the folder list (DON'T OPEN IT)
  • Click OK

How to use it ?

Before using cluster based permutation, you need to define what is your experimental design (within/between subject/between trials, how many factors, how many levels per factor..).

  • Define your design structure
    You need to decide about:
  • How many factors your design is made of: Let's take 3 factors for instance (A~1~, A~2~, A~3~)
  • How many levels each factor A~i~ has : Let's suppose that our factorLevel is [2,3,2]

  • Wich files are associated to each level of each factor
  • The name of your FileStruct variable: Let's say 'LenaFiles'

Then

  • you shoul provide some required parameters
Error rendering macro 'code': Invalid value specified for parameter 'lang'
cfg = [];
cfg                         = load ('neuromag306mag_neighb.mat', 'neighbours');   % could be 'ctf151_neighb.mat', 'neuromag306_neighb.mat','neuromag306planar_neighb.mat' depending on the system and the sensors used
cfg.channel                 = 'MEG';                                              % 'gradiometer','magnetometer'
cfg.latency                 = [0.3 0.7];                                          % which time window to work with. If you need to work on the whole time window use 'all'
cfg.alpha                   = 0.05;                                               % this depends on the significance level
cfg.clustertail             = 0;                                                  % -1, 0, or 1, left, two-sided, or right (default=1)
cfg.tail                    = 0;                                                  % -1, 0, or 1, left, two-sided, or right (default=1)
cfg.numrandomization        = 1000;

At this stage you can start writing your script:

  • open a New File in Matlab Menu (File/New/M-File): This will open a new editor window
  • Write down your MyStructure variable as below: (Suppose you have only .lena files)
    <file>
     MyStructure{1,1,1}= {'file1111.lena', 'file1112.lena', .... 'file111n.lena'};
     MyStructure{1,1,2}= {'file1121.lena', 'file1122.lena', .... 'file112n.lena'};
     MyStructure{1,2,1}= {'file1211.lena', 'file1212.lena', .... 'file121n.lena'};
     .
     .
     .
     MyStructures{2,3,2}= {'file2321.lena', 'file2322.lena', .... 'file232n.lena'};
     </file>
    Suppose in addition that all these files are located in /lena13/home_users/users/datalinks/Manip.
    Note: if the input files are not all located in the same directoy, you have to specify it inside the MyStructure structure as follows

<file>
MyStructure{1,1,2}= {'subject01/file1121.lena', 'subject02/file1122.lena', ....'subject0i/file112i.lena', .........., 'subject0n/file112n.lena'};
</file>
where file112i.lena is located in directory subject0i and subject0i itself is inside '/lena13/home_users/users/datalinks/Manip
Please pay a great attention to the use of the '/' inside the 'PathIn' argument. The concatenation of the 'PathIn' argument and the lenaFiles files must give the correct location of the input file.
Once your 'FileStruct' created, you add at the end of you M-File the appropriate function to compute the statistical followed by multiple comparisons:

Cluster based permutations test on t statistic

  • Event Related Potentials/Fields data
     ttest_cluster_lena (arguments)
  • Time/frequency data
    ttest_freq_cluster_lena (arguments)

Cluster based permutations test on F statistic

  • Event Related Potentials/Fields data
    • within-subject design: anova_cluster_lena(arguments)
    • between-subject design: anova_cluster_lena_bet_sub(arguments)
    • between-trials design: anova_cluster_lena_bet_trl(arguments)
       
  • Time/frequency data
    anova_freq_cluster_lena (arguments)