Mass Univariate ERP Toolbox: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
(41 intermediate revisions by the same user not shown)
Line 13: Line 13:


==What is the Mass Univariate ERP Toolbox?==
==What is the Mass Univariate ERP Toolbox?==
The Mass Univariate ERP Toolbox is a freely available set of MATLAB functions for performing mass univariate analyses of event-related potentials (ERPs), a noninvasive measure of neural activity popular in cognitive neuroscience.  A mass univariate analysis is the analysis of a massive number of simultaneously measured dependent variables via the performance of univariate hypothesis tests (e.g., t-tests).  Savvy corrections for multiple comparisons are applied to make spurious findings unlikely while still retaining a useful degree of statistical power.  This approach is popular in the neuroimaging community but has not been commonly used by ERP researchers.
The Mass Univariate ERP Toolbox is a freely available set of MATLAB functions for performing mass univariate analyses of event-related brain potentials (ERPs), a noninvasive measure of neural activity popular in cognitive neuroscience.  A mass univariate analysis is the analysis of a massive number of simultaneously measured dependent variables via the performance of univariate hypothesis tests (e.g., t-tests).  Savvy corrections for multiple comparisons are applied to make spurious findings unlikely while still retaining a useful degree of statistical power.  This approach is popular in the fMRI community but has not been commonly used by ERP researchers.


The advantages of mass univariate analyses include:
The advantages of mass univariate analyses include:
#They reduce the need for a priori defined time windows/regions of interest
#They reduce the need for a priori defined time windows/regions of interest
#They can reveal unexpected effects even when a priori time windows/regions of interest are available
#They can reveal unexpected effects even when a priori time windows/regions of interest are available
#They take full advantage of the spatial and temporal resolution of EEG and are good for providing lower bounds on the temporal onsets of effects (e.g., the earliest time point at which attention affects stimulus processing)
#They take full advantage of the spatial and temporal resolution of EEG and are good for providing lower bounds on the temporal onsets of effects (e.g., the earliest time point at which some variable or manipulation affects stimulus processing)


The disadvantages of mass univariate analyses include:
The disadvantages of mass univariate analyses include:
#Some loss of statistical power due to correction for multiple comparisons
#Some loss of statistical power due to correction for multiple comparisons (though much less power loss than Bonferroni correction)
#Some popular corrections for multiple comparisons are not guaranteed to work and may not provide the degree of certainty provided by selective analyses of a priori time windows/regions of interest
#Some popular corrections for multiple comparisons are not guaranteed to work and may not provide the degree of certainty provided by selective analyses of a priori time windows/regions of interest


Currently the toolbox supports within and between-subject t-tests with false discovery rate controls, control of the family-wise error rate (FWER) via tmax permutation tests, and cluster based permutation test weak control of the FWER.  This toolbox was produced by members of the Kutaslab of the Department of Cognitive Science at the University of California, San Diego.  <b>If you use the toolbox to perform analyses or to produce figures used in a publication, please cite the following article:</b>


Currently the toolbox supports within and between-subject t-tests with false discovery rate controls and control of the family-wise error rate via permutation tests.  This toolbox was produced by members of the Kutaslab of the Department of Cognitive Science at the University of California, San Diego. If you use the toolbox to perform analyses or to produce figures used in a publication, please cite the following article:
Groppe, D.M., Urbach, T.P., Kutas, M. (2011) [http://www.cogsci.ucsd.edu/~dgroppe/PUBLICATIONS/mass_uni_preprint1.pdf Mass univariate analysis of event-related brain potentials/fields I: A critical tutorial review.] <i> Psychophysiology.</i> 48(12) pp. 1711-1725, DOI: 10.1111/j.1469-8986.2011.01273.x<br>
<br>
The more citations the article gets, the more resources we will be able to dedicate to further developing the toolbox and tutorial materials.
<br>
<br>
The toolbox tutorial in this wiki provides a little bit of background and advice on using these methods. For much more detail, see the above review article (click on the link for a pre-publication copy or [http://onlinelibrary.wiley.com/doi/10.1111/j.1469-8986.2011.01273.x/abstract here] for the published version).  In addition, you can watch this [http://www.cogsci.ucsd.edu/~dgroppe/EEGLAB12_statistics.html short talk] by David Groppe that covers most of the multiple comparison correction methods used by the toolbox (the only method it doesn't cover is cluster-based permutation tests).  Note that our review article covers a method by Korn et al. for control for the generalized family-wise error rate.  This is not fully implemented as part of the toolbox, but the function ''korn_fd1.m'' will compute this procedure for one sample/repeated measures analyses if you need it.<br>
<br>
<span style="color:red;">Note, the toolbox has been tested extensively in our lab and tried on data from several other labs at this point.  However, it is always possible that there are some remaining glitches in the code.  Please [http://openwetware.org/wiki/Mass_Univariate_ERP_Toolbox:_Contact/Questions contact us] if you discover any problems and we will attend to them as soon as possible.  We are always grateful for feedback.</span>
<br><br>


<i>Groppe, D.M., Urbach, T.P., Kutas, M. (in prep) Mass Univariate Analysis of Event-Related Brain Potentials.</i>
(it should be submitted soon!)
<span style="color:red;">Note, the toolbox is currently in its "beta" version.  It has been tested extensively in our lab and tried on data from a couple other labs.  However, we suspect there may be some remaining glitches in the code due to lab idiosyncrasies.  Please contact us if you discover any problems and we will attend to them as soon as possible.  We are particularly grateful for feedback at this stage in the toolbox's development.</span>
<br><br>
==Toolbox Requirements==
==Toolbox Requirements==
To use the toolbox you'll need the following:
To use the toolbox you'll need the following:
Line 39: Line 42:
#The MATLAB statistics toolbox
#The MATLAB statistics toolbox
<br>
<br>
The Mass Univariate ERP Toolbox should work when running MATLAB on Linux or OS X.  However, there may be some issues with writing or reading files when running MATLAB on Windows.  Specifically, the following functions rely on the MATLAB function ''unix.m'' and probably won't work on Windows:
The Mass Univariate ERP Toolbox was originally designed to be used with MATLAB running on Linux or OS X.  It should now work when running MATLAB on Windows as well.  Also note, the screen shots on this wiki were made from MATLAB on OS X.  The GUIs may look somewhat different when produced by MATLAB on Linux or Windows.
*''sets2GND.m''
*''save_erps.m''
*''headinfo.m''
*''GNDs2GRP.m''
*''get_set_infiles.m''
<br>
The remainder of the toolbox functions (e.g., the ones that actually perform the analyses and visualization) should still work fine.  We hope to make all functions Windows compatible in the near future.<br>
<br>
Also note, the screen shots on the wiki were made from MATLAB on OS X.  The GUIs may look somewhat different when produced by MATLAB on Linux or Windows.
<br><br>
<br><br>


==How do I Download the Toolbox?==
==How do I Download the Toolbox?==
You can download the toolbox and sign up for toolbox updates from here: [http://www.mathworks.com/matlabcentral/fileexchange/authors/67384 Download Toolbox]<br><br>
You can download the toolbox and sign up for toolbox updates from here: [http://www.mathworks.com/matlabcentral/fileexchange/29274 Download Toolbox]<br><br>
To sign up for toolbox updates, you will need to register for a free Mathworks account, go to the toolbox download page, and click "Watch this file":<br>
To sign up for toolbox updates, you will need to register for a free Mathworks account, go to the toolbox download page, and click "Watch this File":<br>
[[Image: Watch_file.jpg]]<br>
[[Image: Watch_file.jpg]]<br>
<br><br>
<br>
Once you've downloaded the toolbox, you "install it" by simply adding the directory to your set of MATLAB paths.  The [http://openwetware.org/wiki/Mass_Univariate_ERP_Toolbox:_installing_the_Mass_Univariate_Toolbox first section of the toolbox tutorial] shows you how to do this.<br><br>


==Getting Started==
==Getting Started==
Generally speaking, to use the toolbox, you will need to do the following:<br>
Generally speaking, to use the toolbox, you will need to one of the following:<br>
&nbsp; 1. Install [http://sccn.ucsd.edu/eeglab/ EEGLAB] and familiarize yourself with its operation, particularly the EEGLAB set file data structure for working with fixed-length single trial EEG data (epochs) recorded from a each subject. <br>
===Method A (just EEGLAB required)===
&nbsp; 2. Preprocess the single trial EEG data of each experimental subject you wish to include in your mass uni analysis as follows:<br>
&nbsp; 1. Install [http://sccn.ucsd.edu/eeglab/ EEGLAB] and familiarize yourself with its operation, particularly the EEGLAB set file data structure for working with fixed-length single trial EEG data (epochs) recorded from each subject. <br>
&nbsp; &nbsp; 2.1 Convert your subject’s single-trial EEG data to epochs in the set file format using using EEGLAB’s data import utilities.<br>
&nbsp; 2. Preprocess the single trial EEG data of each experimental subject you wish to include in your mass univariate analysis as follows:<br>
&nbsp; &nbsp; 2.2 Augment the default EEGLAB set file data structure with additional information about the experimental condition(s) = “bins”  that each single trial epoch belongs to using the mass uni toolbox function: bin_info2EEG.m<br>
&nbsp; &nbsp; 2.1 Convert your subject’s continuous EEG data to epochs in the set file format using using EEGLAB’s data import utilities.<br>
&nbsp; 3. Load the augmented individual subject set files into a single MATLAB data structure: GND for within-subjects analysis, GRP for between-subjects analysis. <br>
&nbsp; &nbsp; 2.2 Augment the default EEGLAB set file data structure with additional information about the experimental condition(s), called “bins”,  that each single trial epoch belongs to using the Mass Univariate Toolbox function: bin_info2EEG.m<br>
&nbsp; 4. Conduct the mass univariate analyses on the GND or GRP data structures. <br>
&nbsp; 3. Load the *.erp files into a single "GND"  MATLAB data structure using the Mass Univariate Toolbox function erplab2GND.m.<br>
&nbsp; 4. If you want to perform between-subject analyses, create a "GRP" MATLAB data structure from two or more "GND" data structures.<br>
&nbsp; 5. Conduct the mass univariate analyses on the GND or GRP data structures. <br>
<br>
 
===Method B (EEGLAB & ERPLAB required)===
&nbsp; 1. Install [http://sccn.ucsd.edu/eeglab/ EEGLAB] and  [http://erpinfo.org/erplab ERPLAB] and familiarize yourself with their operation.<br>
&nbsp; 2. Preprocess the single trial EEG data of each experimental subject you wish to include in your mass univariate analysis as follows:<br>
&nbsp; &nbsp; 2.1 Classify experimental events of interest as belonging to "bins" with ERPLAB's [http://erpinfo.org/erplab/erplab-documentation/erplab-manual/Eventlist_Structure.htm "BINLISTER" routine].<br>
&nbsp; &nbsp; 2.2  If you have not already done so, convert your subject’s continuous EEG data to epochs using ERPLAB's [http://erpinfo.org/erplab/erplab-documentation/erplab-manual/Epoching_Bins.htm "Extract Bin-Based Epochs"] menu option.<br>
&nbsp; &nbsp; 2.3 Compute ERPs from each subject using ERPLAB's [http://erpinfo.org/erplab/erplab-documentation/erplab-manual/Averaging_ERPs.htm "Compute Averaged ERPs"] menu option and store the resulting "ERPset" in an ERPLAB *.erp file.<br>
&nbsp; 3. Load the *.erp files into a single "GND"  MATLAB data structure using the Mass Univariate Toolbox function erplab2GND.m.<br>
&nbsp; 4. If you want to perform between-subject analyses, create a "GRP" MATLAB data structure from two or more "GND" data structures.<br>
&nbsp; 5. Conduct the mass univariate analyses on the GND or GRP data structures. <br>
<br>
<br>
Click on the [http://openwetware.org/wiki/Mass_Univariate_ERP_Toolbox:_Tutorial tutorial] for detailed examples of how to use the toolbox.<br>
Click on the [http://openwetware.org/wiki/Mass_Univariate_ERP_Toolbox:_Tutorial TUTORIAL] for detailed examples of how to use the toolbox.<br>
<br>
<br>
<span style="color:red;">Note, to print (or make a pdf of) any pages of this wiki, click the "Printable version" link on the left hand column of each page before printing.</span>
<span style="color:red;">Note, to print (or make a pdf of) any pages of this wiki, click the "Printable version" link on the left hand column of each page before printing.</span>
<br><br>
==Acknowledgments==
Production of the toolbox and documentation were supported by US National Institute of Child Health and Human Development grant HD22614 and National Institute of Aging grant AG08313 to Professor Marta Kutas.<br>
<br>
Thanks to Katherine DeLong for help designing and debugging the toolbox.  Thanks also to Steve Luck, Javier Lopez, and Johanna Kreither for helping to ensure that the toolbox is compatible with ERPLAB. Finally, big thanks to the following individuals who have contributed to the toolbox by fixing bugs in the code (that they identified):<br>
*Gábor Háden<br>
*Amy Guthormsen<br>
*Haibo  Zhou<br>
*Elisa Filevich<br>
*Udo Will<br>
*Aaron Newman<br>

Revision as of 16:31, 12 March 2013


What is the Mass Univariate ERP Toolbox?

The Mass Univariate ERP Toolbox is a freely available set of MATLAB functions for performing mass univariate analyses of event-related brain potentials (ERPs), a noninvasive measure of neural activity popular in cognitive neuroscience. A mass univariate analysis is the analysis of a massive number of simultaneously measured dependent variables via the performance of univariate hypothesis tests (e.g., t-tests). Savvy corrections for multiple comparisons are applied to make spurious findings unlikely while still retaining a useful degree of statistical power. This approach is popular in the fMRI community but has not been commonly used by ERP researchers.

The advantages of mass univariate analyses include:

  1. They reduce the need for a priori defined time windows/regions of interest
  2. They can reveal unexpected effects even when a priori time windows/regions of interest are available
  3. They take full advantage of the spatial and temporal resolution of EEG and are good for providing lower bounds on the temporal onsets of effects (e.g., the earliest time point at which some variable or manipulation affects stimulus processing)

The disadvantages of mass univariate analyses include:

  1. Some loss of statistical power due to correction for multiple comparisons (though much less power loss than Bonferroni correction)
  2. Some popular corrections for multiple comparisons are not guaranteed to work and may not provide the degree of certainty provided by selective analyses of a priori time windows/regions of interest

Currently the toolbox supports within and between-subject t-tests with false discovery rate controls, control of the family-wise error rate (FWER) via tmax permutation tests, and cluster based permutation test weak control of the FWER. This toolbox was produced by members of the Kutaslab of the Department of Cognitive Science at the University of California, San Diego. If you use the toolbox to perform analyses or to produce figures used in a publication, please cite the following article:

Groppe, D.M., Urbach, T.P., Kutas, M. (2011) Mass univariate analysis of event-related brain potentials/fields I: A critical tutorial review. Psychophysiology. 48(12) pp. 1711-1725, DOI: 10.1111/j.1469-8986.2011.01273.x

The more citations the article gets, the more resources we will be able to dedicate to further developing the toolbox and tutorial materials.

The toolbox tutorial in this wiki provides a little bit of background and advice on using these methods. For much more detail, see the above review article (click on the link for a pre-publication copy or here for the published version). In addition, you can watch this short talk by David Groppe that covers most of the multiple comparison correction methods used by the toolbox (the only method it doesn't cover is cluster-based permutation tests). Note that our review article covers a method by Korn et al. for control for the generalized family-wise error rate. This is not fully implemented as part of the toolbox, but the function korn_fd1.m will compute this procedure for one sample/repeated measures analyses if you need it.

Note, the toolbox has been tested extensively in our lab and tried on data from several other labs at this point. However, it is always possible that there are some remaining glitches in the code. Please contact us if you discover any problems and we will attend to them as soon as possible. We are always grateful for feedback.

Toolbox Requirements

To use the toolbox you'll need the following:

  1. MATLAB
  2. EEGLAB, a freely available set of MATLAB tools for EEG analysis
  3. The MATLAB statistics toolbox


The Mass Univariate ERP Toolbox was originally designed to be used with MATLAB running on Linux or OS X. It should now work when running MATLAB on Windows as well. Also note, the screen shots on this wiki were made from MATLAB on OS X. The GUIs may look somewhat different when produced by MATLAB on Linux or Windows.

How do I Download the Toolbox?

You can download the toolbox and sign up for toolbox updates from here: Download Toolbox

To sign up for toolbox updates, you will need to register for a free Mathworks account, go to the toolbox download page, and click "Watch this File":


Once you've downloaded the toolbox, you "install it" by simply adding the directory to your set of MATLAB paths. The first section of the toolbox tutorial shows you how to do this.

Getting Started

Generally speaking, to use the toolbox, you will need to one of the following:

Method A (just EEGLAB required)

  1. Install EEGLAB and familiarize yourself with its operation, particularly the EEGLAB set file data structure for working with fixed-length single trial EEG data (epochs) recorded from each subject.
  2. Preprocess the single trial EEG data of each experimental subject you wish to include in your mass univariate analysis as follows:
    2.1 Convert your subject’s continuous EEG data to epochs in the set file format using using EEGLAB’s data import utilities.
    2.2 Augment the default EEGLAB set file data structure with additional information about the experimental condition(s), called “bins”,  that each single trial epoch belongs to using the Mass Univariate Toolbox function: bin_info2EEG.m
  3. Load the *.erp files into a single "GND" MATLAB data structure using the Mass Univariate Toolbox function erplab2GND.m.
  4. If you want to perform between-subject analyses, create a "GRP" MATLAB data structure from two or more "GND" data structures.
  5. Conduct the mass univariate analyses on the GND or GRP data structures.

Method B (EEGLAB & ERPLAB required)

  1. Install EEGLAB and ERPLAB and familiarize yourself with their operation.
  2. Preprocess the single trial EEG data of each experimental subject you wish to include in your mass univariate analysis as follows:
    2.1 Classify experimental events of interest as belonging to "bins" with ERPLAB's "BINLISTER" routine.
    2.2 If you have not already done so, convert your subject’s continuous EEG data to epochs using ERPLAB's "Extract Bin-Based Epochs" menu option.
    2.3 Compute ERPs from each subject using ERPLAB's "Compute Averaged ERPs" menu option and store the resulting "ERPset" in an ERPLAB *.erp file.
  3. Load the *.erp files into a single "GND" MATLAB data structure using the Mass Univariate Toolbox function erplab2GND.m.
  4. If you want to perform between-subject analyses, create a "GRP" MATLAB data structure from two or more "GND" data structures.
  5. Conduct the mass univariate analyses on the GND or GRP data structures.

Click on the TUTORIAL for detailed examples of how to use the toolbox.

Note, to print (or make a pdf of) any pages of this wiki, click the "Printable version" link on the left hand column of each page before printing.

Acknowledgments

Production of the toolbox and documentation were supported by US National Institute of Child Health and Human Development grant HD22614 and National Institute of Aging grant AG08313 to Professor Marta Kutas.

Thanks to Katherine DeLong for help designing and debugging the toolbox. Thanks also to Steve Luck, Javier Lopez, and Johanna Kreither for helping to ensure that the toolbox is compatible with ERPLAB. Finally, big thanks to the following individuals who have contributed to the toolbox by fixing bugs in the code (that they identified):

  • Gábor Háden
  • Amy Guthormsen
  • Haibo Zhou
  • Elisa Filevich
  • Udo Will
  • Aaron Newman