# Cluster statistics on temporal generalization analysis ouput

**URL:** <https://mne.discourse.group/t/cluster-statistics-on-temporal-generalization-analysis-ouput/4488>\
**Category:** Support & Discussions\
**Tags:** statistics\
**Created:** [February 26, 2022, 1:18pm UTC](https://mne.discourse.group/t/cluster-statistics-on-temporal-generalization-analysis-ouput/4488 "2022-02-26T13:18:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anapesq](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@anapesq](https://mne.discourse.group/u/anapesq)\
**Post date:** [February 26, 2022, 1:18pm UTC](https://mne.discourse.group/t/cluster-statistics-on-temporal-generalization-analysis-ouput/4488/1 "2022-02-26T13:18:28Z")

</div>

Dear all,

I have implemented temporal generalization analysis following the mne example:  
[https://mne.tools/dev/auto\_examples/decoding/decoding\_time\_generalization\_conditions.html](https://mne.tools/dev/auto_examples/decoding/decoding_time_generalization_conditions.html)

I now have for each participant a matrix (test time x train time) with the decoding scores for each test-train time point. Just like in the last figure of the mne example in the url above.

My next step should be to run a cluster analysis to identify any clusters that are significantly \>50% accuracy at the group level.

I looked in the documentation for an example that could guide me, but I didn’t find one. I believe that something similar to doing statistics testing on a single channel TFR plot (frequency x time) could be easily adapted for my purposes.

Does anyone have an example or guidance for this?

Many thanks!

Ana P

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

- MNE version: e.g. 0.24.0
- operating system: e.g. macOS 12 / Windows 10 / Ubuntu 18.04

**📄 Please also provide relevant code snippets – ideally a [minimal working example](https://stackoverflow.com/help/minimal-reproducible-example) (MWE).**

🖋 To get the correct formatting, paste your Python code, then select it, and click on the **Preformatted text** toolbar button.

**📵 Please avoid sharing screenshots of code and error messages!** Screenshots are difficult to work with especially on mobile devices; they don’t allow others to copy code and other text; and they don’t show up in the search.

👉 👉 👉 Please edit or remove the above text before submitting your posting. 👈 👈 👈

---

<div class="post-metadata">

**Author:** ![kingjr](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/kingjr/32/264_2.png) [@kingjr](https://mne.discourse.group/u/kingjr)\
**Post date:** [March 1, 2022, 8:16am UTC](https://mne.discourse.group/t/cluster-statistics-on-temporal-generalization-analysis-ouput/4488/2 "2022-03-01T08:16:04Z")

</div>

Hi,

correct, you can apply a standard cluster statistics on this map.

example here:

> **[Brain Mechanisms Underlying the Brief Maintenance of Seen and Unseen Sensory...](https://www.sciencedirect.com/science/article/pii/S0896627316308017)**
>
> Recent evidence of unconscious working memory challenges the notion that only visible stimuli can be actively maintained over time. In the present stu…

> <https://github.com/kingjr/decod_unseen_maintenance/blob/master/notebook/method_statistics.ipynb>

hope that helps  
JR

---

<div class="post-metadata">

**Author:** ![anapesq](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@anapesq](https://mne.discourse.group/u/anapesq)\
**Post date:** [March 1, 2022, 3:07pm UTC](https://mne.discourse.group/t/cluster-statistics-on-temporal-generalization-analysis-ouput/4488/3 "2022-03-01T15:07:28Z")

</div>

Thank you so much! Most useful. Cheers! Ana P

---

<div class="post-metadata">

**Author:** ![aaboyanova](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@aaboyanova](https://mne.discourse.group/u/aaboyanova)\
**Post date:** [December 2, 2025, 1:16pm UTC](https://mne.discourse.group/t/cluster-statistics-on-temporal-generalization-analysis-ouput/4488/4 "2025-12-02T13:16:03Z")

</div>

What if I have 4 conditions with temp gen matrix per subject. Data shape: 4,30,300,300 (n\_conditions x n\_subjects x n\_time x n\_time) and I want to do a spatio-temporal anova (2x2)? How can i do this? I don’t know how to define the adjacency matrix for temp gen. Is something like this even feasible?
