Permutation T-test on sensor data for EEG

:question: If you have a question or issue with MNE-Python, please include the following info:

  • MNE version: 1.6
  • operating system: Windows 11

I try to use the following code available in MNY Python website for EEG data:

https://mne.tools/stable/auto_examples/stats/sensor_permutation_test.html

This code is written for MEG data to identify significant sensors. I want to do the same for the EEG dataset that I have to identify significant electrodes and then decode data using machine learning.

The change that I made was related to this line of code:
picks = mne.pick_types( raw.info, meg=“grad”, eeg=False, stim=False, eog=True, exclude=“bads” )

Which I change eeg=true and omeg and eog to False. But, the algorithm give me 0 number of significant sensors. Could someone help me with this or introduce me any other method? Do I need to make any other changes to use this for EEG data?

Thanks

Hi!

  • did you use your own EEG data, or did you use the example data, but picking EEG instead of MEG channels?
  • did you adjust the times (tmin, tmax) or the reject parameters of the epoching function?

Maybe there are just no significant differences?

Depending on your answers to my questions above, it looks fair enough what you are doing.

thanks for the reply.

I used my own EEG data and I changed tmin and max as following:
tmin = -.200 # start of each epoch (in sec)
tmax = 1.5000 # end of each epoch (in sec)

I just wanted to mention that I have 16 events (event_id)
Should I change anything with the temporal_mask?

16 events corresponding to 16 trials is not enough for an analysis like this :slight_smile:

how come you only have 16 trials?

I mean 16 event code, not trials. I have 25 subjects, and each event has at least 50 trials for some of the subjects. The number of trials is less for some subjects.
I changed the data and used the data for subject with high numbers of trials, even for the subjects with high number of trials it gives me 0 and I could get answer (two important sensors) just for one subject.
How many number of trials is needed?

it depends on your experimental design, but if for example your 16 event codes correspond to 16 “images” that have been presented to the participant, and each “image” has been presented for around 50 times, then that seems to be a reasonable amount of data to at least try analyses like the present one.

I don’t know why you don’t get any significant sensors then. It might be worth looking into what’s different with that one participant that you do get sig. results with.

1 Like