mne.stats.
permutation_t_test
(X, n_permutations=10000, tail=0, n_jobs=1, verbose=None)¶One sample/paired sample permutation test based on a tstatistic.
This function can perform the test on one variable or simultaneously on multiple variables. When applying the test to multiple variables, the “tmax” method is used for adjusting the pvalues of each variable for multiple comparisons. Like Bonferroni correction, this method adjusts pvalues in a way that controls the familywise error rate. However, the permutation method will be more powerful than Bonferroni correction when different variables in the test are correlated.
Parameters:  X : array of shape [n_samples x n_tests]
n_permutations : int or ‘all’
tail : 1 or 0 or 1 (default = 0)
n_jobs : int
verbose : bool, str, int, or None


Returns:  T_obs : array of shape [n_tests]
p_values : array of shape [n_tests]
H0 : array of shape [n_permutations]

Notes
A reference (among many) in field of neuroimaging: Nichols, T. E. & Holmes, A. P. (2002). Nonparametric permutation tests for functional neuroimaging: a primer with examples. Human Brain Mapping, 15, 125. Overview of standard nonparametric randomization and permutation testing applied to neuroimaging data (e.g. fMRI) DOI: https://doi.org/10.1002/hbm.1058