1

Multiple regression analysis applied to EEG and MEG data

These tools apply multiple linear regression to EEG and MEG data, in contrast to conventional factorial averaging. In short, they provide as output the solution b of the linear equation y=Xb, where y are the data, X the "design matrix" including the predictor variables for all items (e.g. word length, familiarity, etc.), and b contains one regression coefficient per predictor variable.

The input can be Neuroscan cnt-files (EEG) or Neuromag fiff-files (MEG), respectively. The output are either ascii, avg (EEG) or fiff-files (MEG), which can be processes just as conventional ERP/ERFs, e.g. with respect to source analysis or statistics. These tools are still under development. If you would like more information, please contact olaf.hauk@mrc-cbu.cam.ac.uk. A different approach to regression analysis is also part of SPM5.

In order to run your analysis, you should use a text editor (e.g. Textpad, Wordpad etc.) to create a script like the following (why not call it "regress_it.cof" for now):


### #correl_type combine

+ #param_file /whateverthepath/param_file.txt % file that defines predictor variables for each trigger value

+ #correl_columns 4 5 6 7 8 9 % specifies which columns in param_file contain the predictor variables

+ #trigger_columns 2 % specifies which column in param_file.txt contains trigger value (can be more than 1 column)

+ #info_file /whateverthepath/info_file.txt % output file for number of valid trials per input file

+ #mag_thresholds 2500 0 1500 0 % thresholds for artefact rejection, magnetometers (fT)

+ #grad_thresholds 1000 0 800 0 % thresholds for artefact rejection, gradiometers (fT/cm)

+ #eog_channels 307 308 % channel number of EOG channels

+ #thresholds 150 0 100 0 % thresholds for artefact rejection, EOG (uV)

+ #baseline -100 0 % interval for baseline correction with respect to trigger onset

+ #epoch_length 500 % length of epoch to be analysed

+ #pre_stim_time -100 % start latency of epoch (can be different from baseline)

%

% The following commands are specified for individual input files:

#fif /whateverthepath/MEG_infile.fif % input fiff-file

+ #outfif /whateverthepath/MEG_outfile.fif % base for output fiff-file (there will be different files for different regressors)

+ #fiff_template /whateverthepath/MEG_template.fif % if specified, sensor information from this file will be used for output

%

% Add more files in the same way:

#fif /whateverthepath/MEG_infile2.fif % input fiff-file

+ #outfif /whateverthepath/MEG_outfile2.fif % base for output fiff-file (there will be different files for different regressors)

+ #fiff_template /whateverthepath/MEG_template2.fif % if specified, sensor information from this file will be used for output

%

% If you want to assign new values to the triggers in the fiff-file, add "#event_list":

#fif /whateverthepath/MEG_infile3.fif % input fiff-file

+ #outfif /whateverthepath/MEG_outfile3.fif % base for output fiff-file (there will be different files for different regressors)

+ #fiff_template /whateverthepath/MEG_template3.fif % will be used for head coordinates

+ #event_list /whateverthepath/events3.txt 1 % The "1" indicates the column(s) in events3.txt that contain(s) the new trigger values. The file must contain as many values as there are triggers in the fiff-file. It will only produce a warning if this is not the case (see the log-file info_file.info_log), so be aware!


The file param_file.txt could for example look like this:

(first column is the name of the stimulus, 2nd/3rd are trigger values, and the rest are predictor variables)

apple.bmp 107 3 1.392900 -0.479850 0.417390 0.080390 1.092110 0.115550 625.0

axe.bmp 145 5 -0.914140 1.043010 -1.223180 0.280600 1.395510 1.153300 740.0

ball.bmp 122 6 1.721340 -0.171140 -1.435500 -1.734850 -1.500380 0.311110 712.0

balloon.bmp 22 7 0.340310 0.050460 1.517780 -0.214130 1.548640 -1.440000 676.0

banana.bmp 52 8 0.280850 0.032000 -0.283840 -0.220450 0.876610 -0.513280 584.0

barrel.bmp 18 9 -0.966440 -0.128640 -1.260160 -0.348910 0.028620 -0.941300 588.0

basket.bmp 94 10 -0.676920 0.809610 -0.015460 -1.146530 -1.728440 -1.320280 642.0

bed.bmp 30 11 1.923550 0.518270 1.482960 -0.264860 0.419940 0.693060 500.0

belt.bmp 46 13 0.317560 0.866460 -1.206650 -0.045100 0.528740 -0.779480 833.0

bird.bmp 99 15 1.360470 -1.867280 0.344520 -0.981430 -1.532860 1.941360 898.0

book.bmp 54 16 1.765150 1.272160 1.076190 0.161320 1.236470 -0.198840 546.0

bottle.bmp 49 18 1.083290 1.188760 -0.516730 -0.057490 -0.923770 0.478310 590.0

bow.bmp 108 19 0.500370 -0.256740 -0.935070 -2.023320 -2.340750 -1.261620 597.0

...


Note that anything following a "%" will be ignored (e.g. comments), anything following "#" is a command, and "+" signifies that this command still belongs to the same file. Once you are happy with your script and you have mentally prepared for it, run the script using

EEG_correlation('regress_it.cof')

in the Matlab command window.

It probably won't work, most likely because you've forgotten to add the following paths in the Matlab command window:

addpath /imaging/olaf/MEG/cam_tools /imaging/olaf/MEG/cam_tools/MEG /imaging/olaf/MEG/analysis

(a mistake easy to do, because I haven't told you to add them yet).

(and yes, sorry, it's not on Subversion yet)


More on linear regression can be found in standard text books, such as: