statcond#

statcond(data, *args, **kwargs)#

Compare condition arrays using EEGLAB-style t-tests or ANOVAs.

Python callers pass keywords. Positional name/value pairs are accepted through parse_key_value_args(), including EEGLAB names such as mode, verbose, returnresamplingarray, and structoutput.

Parameters:
  • data (Any) – One- or two-dimensional sequence of condition arrays. The case dimension is the last axis by default.

  • paired – "auto", "on"/True, or "off"/False.

  • method – "param", "perm", or "bootstrap". mode is the legacy alias and wins when it is non-empty.

  • naccu – Number of surrogate samples for nonparametric methods.

  • variance – "homogenous" or "inhomogenous" for unpaired t-tests. The default is Welch’s inhomogenous variance, matching EEGLAB finputcheck in statcond.m:187. ttest2_cell still defaults to equal variance, matching ttest2_cell.m:79.

  • forceanova – Use one-way ANOVA instead of a two-condition t-test.

  • tail – Empirical-tail mode for supplied or computed surrogates.

  • axis – Axis in each condition array that stores cases.

  • rng – Optional NumPy generator or seed for the Python resampling stream.

  • alpha – Optional threshold for confidence intervals and masks. threshold is the legacy alias. NaN means unset.

  • surrog – Precomputed surrogate statistic array.

  • stats – Observed statistic to pair with surrog.

  • return_resampling_array – Return surrogate condition grids instead of computing statistics. returnresamplingarray is the EEGLAB name.

  • arraycomp – True/"on" batches all resamples. False/"off" computes one resample at a time and, with return_resampling_array=True, returns one grid as in EEGLAB.

  • verbose – "on" logs the selected design. The default is "off".

  • structoutput – Accepted for EEGLAB calls. The Python return is still a StatcondResult; a single MATLAB output is the struct.

  • cluster – "on" replaces pointwise permutation p-values with cluster extent results for one-way designs. The cluster-forming threshold uses the test degrees of freedom. EEGLAB’s statcond.m:470 calls tcdf(-abs(surrogval), size(surrogval,1)) and statcond.m:490 calls tcdf(-abs(ori_vals), length(ori_vals)), so both thresholds use the feature count. That degrees-of-freedom choice is not reproduced.

  • args (Any)

  • kwargs (Any)

Returns:

A StatcondResult, or a SurrogateDistribution when return_resampling_array is true. Computed two-way result fields use named rows, columns, and interaction effects in that order for both paired and unpaired designs. MATLAB-shaped copies live on matlab_stat, matlab_df, matlab_pvalue, and matlab_surrogate. Unpaired two-way MATLAB cells are stored in column, row, interaction order.

Return type:

StatcondResult | SurrogateDistribution