Matching trial counts in an oddball task

External Email - Use Caution

Hi all,

I have designed an oddball visual experiment. So, I have different numbers
of trials in two conditions (standard vs deviant). For doing the
time-frequency analysis I have to match the trials counts in each
condition. In other words, I should sample from the standard condition to
have an identical number of trials to the deviant condition. One way could
be sampling randomly from the standard condition which will give me
different results each time I run the code. I wonder whether there is a
better way for matching trials count in each condition in time-frequency
analysis in MNE.

Regards,
-Maryam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190303/28bcec85/attachment-0001.html

Hi Maryam,

There are multiple approaches to equalize the epoch count across
conditions, please look at the following example

https://martinos.org/mne/dev/auto_tutorials/plot_stats_cluster_time_frequency_repeated_measures_anova.html?highlight=equalize_event_counts

and the API documentation

https://martinos.org/mne/dev/generated/mne.Epochs.html?highlight=equalize_event_counts#mne.Epochs.equalize_event_counts

Thanks

Sheraz

External Email - Use Caution

Hi Sheraz Khan,

Thank you for your help. I have two questions regarding this function:

Is the mechanism of "mne.Epochs.equalize_event_count
<https://martinos.org/mne/dev/generated/mne.Epochs.html#mne.Epochs.equalize_event_counts>"
function
that it randomly picks samples from the condition with more trials so that
their occurring timing would be close to the trials in another condition
with fewer trials?

Also, this function needs events_id. In my experiment, I didn't put
different triggers/events_id for each condition. All conditions now have
identical events_id. I grouped my conditions based on my metadata. Is there
any way to update my events_id according to the metadata?

Regards,
-Maryam