# Statistical tests for connectivity measures

**URL:** <https://mne.discourse.group/t/statistical-tests-for-connectivity-measures/7295>\
**Category:** Support & Discussions\
**Tags:** statistics, connectivity\
**Created:** [July 27, 2023, 11:42am UTC](https://mne.discourse.group/t/statistical-tests-for-connectivity-measures/7295 "2023-07-27T11:42:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lokinou](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/lokinou/32/756_2.png) [@lokinou](https://mne.discourse.group/u/lokinou)\
**Post date:** [July 27, 2023, 11:42am UTC](https://mne.discourse.group/t/statistical-tests-for-connectivity-measures/7295/1 "2023-07-27T11:42:46Z")

</div>

It’s more a methods and mathematical question rather than a pure software question.

I have one participant with about 500x 2 second epochs of EEG data with 64channels in two difference sessions, let’s call them PRE and POST. I also have a 1 minute rest measurement for each session

I want to perform inverse connectivity measurements in the alpha range. For that I use the baseline measurement as noise covariance matrix (and use `/fsaverage/bem/fsaverage-ico-5-src.fif`)

My issue is that if I use `spectral_connectivity_epochs` with wpli method I only get 1 value for PRE and 1 value for POST. I could not find any mean to assess the significance of each and every comparison in the dimension 2 connectivity matrix.

Therefore i used `spectral_connectivity_time` on each epoch, providing me a dimension 3 connectivity matrix. By running a z-test (left skewed distribution), and p-value correction for multiple comparisons I was able to check for significance between surface areas.

I would like to ask whether splitting trials in 2 second epochs, then individually assess connectivity is a correct method to go or whether there are underlying issues with the method used.

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [August 3, 2023, 8:02pm UTC](https://mne.discourse.group/t/statistical-tests-for-connectivity-measures/7295/2 "2023-08-03T20:02:54Z")

</div>

unfortunately we don’t have good support yet for estimating statistical significance of connectivity structures. There are discussions / efforts underway to do this, e.g.

- [[ENH, WIP] Add Estimation of Significant Connectivity by alexrockhill · Pull Request #101 · mne-tools/mne-connectivity · GitHub](https://github.com/mne-tools/mne-connectivity/pull/101)
- [A good tutorial on "statistics in connectivity estimation" · Issue #35 · mne-tools/mne-connectivity · GitHub](https://github.com/mne-tools/mne-connectivity/issues/35)

and you might also want to check out [GitHub - microsoft/graspologic: Python package for graph statistics](https://github.com/microsoft/graspologic) to see if it fits your use case.

cc @adam2392 in case you have more to add.
