conpy.stats.
cluster_permutation_test
(cond1, cond2, cluster_threshold, src, alpha=0.05, tail=0, n_permutations=1024, max_spread=0.013, cluster_method='single', seed=None, return_details=False, n_jobs=1, verbose=None)¶Find significant bundles of connections using a permutation test.
This is a variation on the cluster permutation test described in [1].
First, connections are thresholded using a paired 2-sided t-test. Any connections that survive the threshold are grouped into “bundles”. A bundle is a group of connections which start and end points are close together. Then, for each bundle, the sum of the t-values of its connections is evaluated against those obtained from using the same procedure on random permutations of the data. For further information, see [2].
For each subject, the connectivity object corresponding to the first experimental condition. Each connectivity object should define the same connections.
For each subject, the connectivity object corresponding to the second experimental condition. Each connectivity object should define the same connections.
The threshold to use for forming the intial bundles. Only connections
with a t-value that is either higher than cluster_threshold
or
lower than -cluster_threshold
are kept.
Which “tail” of the distribution of the test statistic to use:
- -1: the hypothesis is that cond1 < cond2.
0: the hypothesis is that cond1 != cond2. 1: the hypothesis is that cond1 > cond2.
Defaults to 0, meaning a two-tailed test.
The source space for which the connectivity is defined.
The p-value to use for null-hypothesis testing. Using random permutations, the distribution of t-values is estimated. Bundles with a t-value in the requested percentile will be deemed significant. Defaults to 0.05.
The number of random permutations to use to estimate the distribution of t-values. Defaults to 1024.
Maximum amount the position (in metres) of the start and end points of the connections may vary in order for them to be considered part of the same “bundle”. Defaults to 0.013.
Linkage method for fclusterdata. Defaults to ‘single’. See
documentation for scipy.cluster.hierarchy.fclusterdata
for for more
information.
The seed to use for the random number generator. Use this to reproduce
a specific result. Defaults to None
so a different seed is used
every time.
Whether to return details about the bundles and the permulation stats. Defaults to False.
Number of jobs to run in parallel. Note that a copy of cond1
and
cond2
will be made for each job in memory. Defaults to 1.
If not None
, override default verbose level
(see mne.verbose()
and Logging documentation
for more).
Indices of the connections that are part of a significant bundle.
For each found bundle, the indices of the connections that are part of
the bundle. Only returned when return_details=True
is specified.
For each found bundle, the sum of the t-values for all connections that
are part of the bundle. These are the t-values that were used to
determine the initial threshold for the connections. They are not
indicative of the null-hypothesis.
Only returned when return_details=True
is specified.
For each found bundle, the p-value based on the permutation test,
indicative for the likelyhood that the null-hypothesis holds.
Only returned when return_details=True
is specified.
The maximum observed t-value during each random permutation.
Only returned when return_details=True
is specified.
References
Maris/Oostenveld (2007), “Nonparametric statistical testing of EEG- and MEG-data” Journal of Neuroscience Methods, Vol. 164, No. 1., pp. 177-190. doi:10.1016/j.jneumeth.2007.03.024.
van Vliet, M., Liljeström, M., Aro, S., Salmelin, R., & Kujala, J. (2018). Analysis of functional connectivity and oscillatory power using DICS: from raw MEG data to group-level statistics in Python. bioRxiv, 245530, 1-25. https://doi.org/10.1101/245530