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.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

mega_anova

mega_anova is used to compare the differences between groups of means. The design to be analyzed (or data model) can comprise any number of independent factors, each with multiple levels, and with or without repeated measurements.

The input files could be in*.ds* (CTF) .fiff (Neuromag/Elekta) .lena or .mat

The output files (F and p or -logp 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/global/matlab
  • Highlight the mega_toolbox directory in the folder list (DON'T OPEN IT)
  • Click OK
  • Click Save in the Set Path dialog window
  • You're done

How to use it ?

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

The steps to perform are as follows:

  • Define your design structure: FileStruct
   This argument is **required**. This is  the name of the a<sub>1</sub>by­a<sub>2</sub>by­...a<sub>m</sub> cell array that contains the names of the files to be analysed  (this will be your main job !)

Write down your*MyStructure* variable as below: (Suppose you have only .lena files and 3-way design of 2x3x2)
<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>

  • Write a script in matlab to provide information about your data as well as your experimental design:

Required arguments

This argument is required. It is an array of m integers: [a_1_, a_2_ ..a_m_] where m is the number of factors and each a_i_ is the number of levels of the ith factor
example:
<file>
mega_anova (...,'FactorLevel', [3 2], ....) </file>
means that your design is made of two factors that have 3 and 2 levels respectively. Beware that the order in which you declare your factors is important and must be consistent throughout your parameters and variables definition.

This argument is required.It is the variable MyStructure that you decalred above

example:
<file> mega_anova ('FactorLevel', [3 2], 'FileStruct', MyStructure....)</file>

Optional arguments

This argument is optional. It is a string that specifies the Path to the folder where the input files (as defined in your FileStruct ) are located.If not specified, the files are searched in the current folder (displayed in Matlab)
Usage: <file> mega_anova (..., .....,.....,'PathIn', '/lena13/home_users/users/datalinks/MYMANIP') </file>
or
<file> mega_anova(.....,.....,'PathIn','/lena13/home_users/users/datalinks/MYMANIP/') </file>
The last slash is to be added if it is not specified in your FileStruct.

This argument is optional. It is a string that specifies the path to the folder where to write the output .lena files of the analysis.If not specified, the files are written in the current folder.
Usage:
<file> mega_anova('PathOut','/pclxserver/data/users/datalinks/MYMANIP/MyAnovaResult') </file>
Note that you may or may not add a final slash to the folder specified, the program will deal with it.

This argument is optional. It is a string that specifies the prefix of the output file. If not specified, the following default names are used:
FanovaEffect(info).lena
panovaEffect(info).lena
FanovaEffect(ij).lena
panovaEffect(ij).lena
i for the i ||th|| factor and (ij) for the interaction between the i||th|| and the j||th|| factors.
Usage: <file> mega_anova (..., 'FilePrefix', 'Pouet',...)</file> will produce the following output files if your design is made of two factors:
PouetF1.lena, Pouetp1.lena,
PouetF2.lena, Pouetp2.lena,
PouetF12.lena, Pouetp12.lena

This argument is optional. It is a small trick for advanced users. It is a Boolean used only in the case where each factor Ai has exactly two levels, with means mi1 and mi2 for the levels 1 and 2 of the ith factor.
If m_i1_<m_i2_, the F value for the effect of Ai will be multiplied by -1.
Note: This argument is a boolean and is single (is not a named argument with a name and a value)
Usage: <file> mega_anova (..., 'FilePrefix', 'Pouet','SignedF')</file>

This argument is optional. It is a boolean used only in case where -Log(p)is preferred to p value
Note: This argument is a boolean and is single (is not a named argument with a name and a value)
Usage: <file> mega_anova (..., 'FilePrefix', 'Pouet','SignedF', 'minusLogp')</file>

This argument is optional but very important! It tells whether the design is*between_trials*, between_subjects or within_subjects (repeated measurments)
By default, the design is within-subject
Usage: <file> mega_anova ('FileStruct', MyStructure,...,'FactorLevel', [3 2], 'FilePrefix', 'Pouet','SignedF', 'minusLogp', 'design', 'between_trials')</file>
<file> mega_anova ('FileStruct', MyStructure,...,'FactorLevel', [3 2], 'FilePrefix', 'Pouet','SignedF', 'minusLogp', 'design', 'between_subjects')</file>

Very important!
If your design is between trials, you need to put only one file ( which includes all the trials) per condtion in your FileStruct variable

This argument is also optional ! It is used to specify the format when it is .mat. By default, the format is .lena/.ds/.fiff
Usage: <file> mega_anova ('FileStruct', MyStructure,...,'FactorLevel', [3 2], 'FilePrefix', 'Pouet','SignedF', 'minusLogp', 'design', 'between_trials', 'format', '.mat')</file>

Back

  • No labels