mne.stats.ClusterResult#

class mne.stats.ClusterResult(*, stat_obs, clusters, cluster_p_values, H0, stat_fun, n_permutations, t_power=1.0, contrast=None)[source]#

Object containing the results of the cluster permutation test.

Note

This class is not meant to be instantiated directly, but rather returned by cluster_test().

Parameters:
stat_obsnp.ndarray

The observed test statistic.

clusterslist

List of clusters.

cluster_p_valuesnp.ndarray

P-values for each cluster.

H0np.ndarray

Max cluster level stats observed under permutation.

stat_funcallable() | None

Function called to calculate the test statistic. Must accept 1D-array as input and return a 1D array. If None (the default), uses mne.stats.ttest_1samp_no_p() for paired tests and mne.stats.f_oneway() for unpaired tests or tests of more than 2 groups.

n_permutationsint

The number of permutations actually run, counting the observed arrangement. When the design admits an exact test this is smaller than the n_permutations passed to cluster_test(): all distinct rearrangements are evaluated and no more.

t_powerfloat

Power to which the observed statistic was raised (sign retained) before summing within a cluster to obtain its mass (see cluster_masses). Should match whatever t_power was passed to cluster_test().

contrasttuple of str | None

The two levels that were contrasted, as (positive, reference); the data were computed as the first minus the second. None when no subtraction was performed.

Attributes:
cluster_massesnp.ndarray

The mass of each cluster, i.e. the sum (optionally t_power-weighted) of stat_obs within that cluster. This is the same per-cluster statistic that is compared against the permutation distribution (H0) to obtain cluster_p_values, so it is a natural way to rank clusters by how extreme they are, independent of the resulting p-value.

referencestr | None

The level that was subtracted, i.e. contrast[1], or None.

stat_namestr

Human-readable name of the statistic in stat_obs, e.g. "paired T-statistic". Reflects the test that formula, within_id and stat_fun selected, and is "test statistic" for a custom stat_fun.

Notes

New in v1.13.

Examples using mne.stats.ClusterResult#

Group-level cluster permutation testing with formula contrasts

Group-level cluster permutation testing with formula contrasts