Functions for statistical analysis.

Parametric statistics (see scipy.stats and statsmodels for more options):

ttest_1samp_no_p(X[, sigma, method])

Perform one-sample t-test.

ttest_ind_no_p(a, b[, equal_var, sigma])

Independent samples t-test without p calculation.


Perform a 1-way ANOVA.

f_mway_rm(data, factor_levels[, effects, …])

Compute M-way repeated measures ANOVA for fully balanced designs.

f_threshold_mway_rm(n_subjects, factor_levels)

Compute F-value thresholds for a two-way ANOVA.

linear_regression(inst, design_matrix[, names])

Fit Ordinary Least Squares (OLS) regression.

linear_regression_raw(raw, events[, …])

Estimate regression-based evoked potentials/fields by linear modeling.

Mass-univariate multiple comparison correction:

bonferroni_correction(pval[, alpha])

P-value correction with Bonferroni method.

fdr_correction(pvals[, alpha, method])

P-value correction with False Discovery Rate (FDR).

Non-parametric (clustering) resampling methods:


Create a sparse binary adjacency/neighbors matrix.

permutation_cluster_test(X[, threshold, …])

Cluster-level statistical permutation test.

permutation_cluster_1samp_test(X[, …])

Non-parametric cluster-level paired t-test.

permutation_t_test(X[, n_permutations, …])

One sample/paired sample permutation test based on a t-statistic.

spatio_temporal_cluster_test(X[, threshold, …])

Non-parametric cluster-level test for spatio-temporal data.

spatio_temporal_cluster_1samp_test(X[, …])

Non-parametric cluster-level paired t-test for spatio-temporal data.

summarize_clusters_stc(clu[, p_thresh, …])

Assemble summary SourceEstimate from spatiotemporal cluster results.

bootstrap_confidence_interval(arr[, ci, …])

Get confidence intervals from non-parametric bootstrap.

Compute adjacency matrices for cluster-level statistics:

channels.find_ch_adjacency(info, ch_type)

Find the adjacency matrix for the given channels.

channels.read_ch_adjacency(fname[, picks])

Parse FieldTrip neighbors .mat file.

spatial_dist_adjacency(src, dist[, verbose])

Compute adjacency from distances in a source space.

spatial_src_adjacency(src[, dist, verbose])

Compute adjacency for a source space activation.

spatial_tris_adjacency(tris[, …])

Compute adjacency from triangles.

spatial_inter_hemi_adjacency(src, dist[, …])

Get vertices on each hemisphere that are close to the other hemisphere.

spatio_temporal_src_adjacency(src, n_times)

Compute adjacency for a source space activation over time.

spatio_temporal_tris_adjacency(tris, n_times)

Compute adjacency from triangles and time instants.

spatio_temporal_dist_adjacency(src, n_times, …)

Compute adjacency from distances in a source space and time instants.