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_obs
np.ndarray The observed test statistic.
- clusters
list List of clusters.
- cluster_p_values
np.ndarray P-values for each cluster.
- H0
np.ndarray Max cluster level stats observed under permutation.
- stat_fun
callable()|None Function called to calculate the test statistic. Must accept 1D-array as input and return a 1D array. If
None(the default), usesmne.stats.ttest_1samp_no_p()for paired tests andmne.stats.f_oneway()for unpaired tests or tests of more than 2 groups.- n_permutations
int The number of permutations actually run, counting the observed arrangement. When the design admits an exact test this is smaller than the
n_permutationspassed tocluster_test(): all distinct rearrangements are evaluated and no more.- t_power
float Power to which the observed statistic was raised (sign retained) before summing within a cluster to obtain its mass (see
cluster_masses). Should match whatevert_powerwas passed tocluster_test().- contrast
tupleofstr|None The two levels that were contrasted, as
(positive, reference); the data were computed as the first minus the second.Nonewhen no subtraction was performed.
- stat_obs
- Attributes:
- cluster_masses
np.ndarray The mass of each cluster, i.e. the sum (optionally
t_power-weighted) ofstat_obswithin that cluster. This is the same per-cluster statistic that is compared against the permutation distribution (H0) to obtaincluster_p_values, so it is a natural way to rank clusters by how extreme they are, independent of the resulting p-value.- reference
str|None The level that was subtracted, i.e.
contrast[1], orNone.- stat_name
str Human-readable name of the statistic in
stat_obs, e.g."paired T-statistic". Reflects the test thatformula,within_idandstat_funselected, and is"test statistic"for a customstat_fun.
- cluster_masses
Notes
New in v1.13.
Examples using mne.stats.ClusterResult#
Group-level cluster permutation testing with formula contrasts