# Issues with group analysis

**URL:** <https://mne.discourse.group/t/issues-with-group-analysis/6987>\
**Category:** Support & Discussions\
**Created:** [May 30, 2023, 3:07pm UTC](https://mne.discourse.group/t/issues-with-group-analysis/6987 "2023-05-30T15:07:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeW](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mikew/32/2276_2.png) [@MikeW](https://mne.discourse.group/u/MikeW)\
**Post date:** [May 30, 2023, 3:07pm UTC](https://mne.discourse.group/t/issues-with-group-analysis/6987/1 "2023-05-30T15:07:39Z")

</div>

Hi I am having some issues with averaging epochs into evoked files for multiple participants at once and I can’t find any information on it.

Normally you would do something like:

condition1\_evokeds = epochs[‘condition1’].average()

But I can’t get this to work with my for loop, reading in multiple epopched files into one dictionary using the code:

epochs = {}  
for i, idx in enumerate(conditions):  
epochs[i] = [mne.read\_epochs(d, preload=True)[idx] for d in data\_files]

How to I take the epoch dictionary and average it out, or turn it into evokeds so that I can plot certain conditions?

Thank you for any help!

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [May 30, 2023, 6:01pm UTC](https://mne.discourse.group/t/issues-with-group-analysis/6987/2 "2023-05-30T18:01:45Z")

</div>

Please provide more code context and an error message. It’s difficult to help otherwise. Thanks!

---

<div class="post-metadata">

**Author:** ![MikeW](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mikew/32/2276_2.png) [@MikeW](https://mne.discourse.group/u/MikeW)\
**Post date:** [June 10, 2023, 11:09am UTC](https://mne.discourse.group/t/issues-with-group-analysis/6987/3 "2023-06-10T11:09:22Z")

</div>

So I am looking to do some group analysis with the epochs structure (especially some TFR work) but when I read in my epochs using the above for loop, and then isolate a condition to create a list, I can’t run epochs.compute\_psd().

Is there any documentation on running group analysis on these sorts of things? For example, I would like to do some ERDS at the group level using this tutorial ([Compute and visualize ERDS maps — MNE 1.4.2 documentation](https://mne.tools/stable/auto_examples/time_frequency/time_frequency_erds.html)) but it is for one file not many.
