statcondfieldtrip#

statcondfieldtrip(data, *, paired='auto', method='analytic', mode=None, naccu=200, variance='homogenous', mcorrect='none', alpha=0.05, axis=-1, rng=None, neighbours=None, clusteralpha=0.05, clusterstatistic='maxsum', clusterthreshold='parametric', clustercritval=None)#

Compare conditions using the supported statcondfieldtrip contract.

The standalone backend supports paired and unpaired two-condition t-tests plus unpaired one-way ANOVA. Condition arrays may have any number of feature axes; cases occupy axis and result arrays preserve the feature shape.

Parameters:
  • data (Any) – Sequence of condition arrays.

  • paired (str | bool) – Pairing mode. "auto" pairs conditions only when every case count is equal.

  • method (str) – "analytic" or "montecarlo". EEGLAB aliases "param", "parametric", "perm", "permutation", and "bootstrap" are accepted; bootstrap follows EEGLAB’s FieldTrip wrapper and selects permutation inference.

  • mode (str | None) – EEGLAB alias for method. A non-empty value takes precedence.

  • naccu (int | str) – Number of permutations for Monte Carlo inference, or "all" to enumerate small permutation spaces exactly.

  • variance (str) – Equal-variance mode for an unpaired t-test. Both spellings of "homogeneous" are accepted.

  • mcorrect (str) – Multiple-comparison correction: "none", "bonferroni", "holm", "fdr", "max", or "cluster". EEGLAB/FieldTrip spellings "bonferoni" and "holms" are accepted. Max correction requires Monte Carlo inference.

  • alpha (float) – Family significance threshold used to form mask.

  • axis (int) – Case axis in every condition array.

  • rng (Generator | int | None) – Optional NumPy generator or seed for Monte Carlo inference.

  • neighbours (Any) – Explicit square, symmetric adjacency matrix over features flattened in NumPy C order. Dense and SciPy sparse matrices are supported. Required for cluster correction and otherwise rejected.

  • clusteralpha (float) – Per-feature cluster-forming probability. Two-condition tests split it equally between the two tails.

  • clusterstatistic (str) – Cluster statistic. Only FieldTrip’s default "maxsum" is supported.

  • clusterthreshold (str) – Cluster-forming threshold policy. Only "parametric" is supported.

  • clustercritval (float | None) – Optional positive statistic cutoff overriding the value derived from clusteralpha and the reference distribution.

Returns:

A structured result. Iteration yields stat, df, and pvalue for compatibility with the MATLAB function’s three outputs. Pointwise corrections leave pvalue unadjusted and correct mask instead; max-statistic and cluster correction return family-wise corrected pvalue. Cluster results also expose the observed labels, cluster records, critical statistic, and maximum-cluster null distribution.

Raises:
  • NotImplementedError – For paired one-way ANOVA, two-way designs, or unsupported cluster-statistic and threshold policies.

  • ValueError – For invalid methods, corrections, alpha, variance, or condition shapes.

Return type:

StatcondFieldtripResult