Tutorial 16: Average response

Authors: Francois Tadel, Elizabeth Bock, Sylvain Baillet

All the epochs we have imported in the previous tutorial are represented by matrices that have the same size (same number of channels, same number of time points), therefore they can be averaged together by experimental condition. The result is called indifferently "evoked response", "average response", "event-related field" in MEG (ERF) or "event-related potential" in EEG (ERP). It shows the components of the brain signals that are strictly time-locked to the presentation of a stimulus.


We will now compute the average responses for both the "standard" and "deviant" conditions. Two constraints have to be taken into consideration at this stage.

Averaging runs separately: With MEG, it is not recommended to average sensor data across acquisition runs with different head positions (ie. different "channel files"). If the head of the subject moved between two blocks of recordings, the sensors do not record the same parts of the brain before and after, therefore the runs cannot be compared directly. With EEG, you can generally skip this recommendation.

Number of trials: When computing subject-level averages for experimental conditions with different number of trials, you have two options. You can either use the same number of trials for all the conditions and subjects (to make them "more comparable") or use all the available good trials (more samples lead to better estimations of the mean and variance). Here we will go with the second option, using all the trials. See this advanced section for more details.

Process options: Average

Description of all the options of the process: Average > Average files.

Visual exploration

The average response contains interesting information about the brain operations that occur shortly after the presentation of the stimulus. We can explore two dimensions: the location of the various brain regions involved in the sensory processing and the precise timing of their activation. Because these two types of information are of equal interest, we typically explore the recordings with two figures at the same time, one that shows all the signals in time and one that shows their spatial distribution at one instant.

Add a spatial view:

Repeat the same operations for Run#02:


Let's display the two conditions "standard" and "deviant" side-by-side, for Run#01.

The legend in blue shows names often used in the EEG ERP literature:

Additional quality check with the event markers:


Averaging bad channels

The bad channels can be defined independently for each trial, therefore we can have different numbers of data points averaged for different electrodes. If we have a channel A considered good for NA trials, the corresponding channel in the average file is computed in this way: sum(NA trials) / NA.

In the average file, a channel is considered good if it is good in at least one trial, and considered as bad if it is bad in all the trials. The entire file is then considered as if it were computed from the maximum number of good trials: Nmax = max(Ni), i=1..Ntrials.

This procedure allows the conservation of the maximum amount of data. However it may cause some unwanted effects across channels: the SNR might be higher for some channels than others. If you want to avoid this: mark the channels as bad in all the trials, or report all the bad channels to the average file. This can be done easily using the database explorer, see tutorial Bad channels.


Averaging across runs

As said previously, it is usually not recommended to average MEG recordings in sensor space across multiple acquisition runs because the subject might have moved between the sessions. Different head positions were recorded for each run, so we will reconstruct the sources separately for each each run to take into account these movements.

However, in the case of event-related studies it makes sense to start our data exploration with an average across runs, just to evaluate the quality of the evoked responses. We have seen in tutorial #4 that the subject almost didn't move between the two runs, so the error would be minimal.

Let's compute an approximate average across runs. We will run a formal average in source space later.


Standard error

If you computed the standard deviation or the standard error together with an average, it will be automatically represented in the time series figures.


Number of trials

You should always be careful when comparing averages computed from different numbers of trials. In most cases, you can safely include all the trials in your averages, even in the case of imbalanced designs. However, for very low numbers of trials or when comparing peak amplitudes, having the same number of trials becomes more critical. See the following references for more details:


Selecting equal numbers of trials

If you decided you want to use the same number of trials across all the experimental conditions and/or across all the subjects, you can use a process to select them easily from the database.

Process options

Available options in the process: File > Select uniform number of trials.

How many trials to select in each group:

How to select trials in a group that contains more than the requested number (Nf files, selecting only Ns):

On the hard drive

The average files have the same structure as the individual trials, described in the tutorial Import epochs.

Differences with the imported epochs

Feedback: Comments, bug reports, suggestions, questions
Email address (if you expect an answer):

Tutorials/Averaging (last edited 2016-04-11 22:53:19 by FrancoisTadel)