mne.stats.ttest_1samp_no_p

mne.stats.ttest_1samp_no_p(X, sigma=0, method='relative')[source]

Perform one-sample t-test.

This is a modified version of scipy.stats.ttest_1samp() that avoids a (relatively) time-consuming p-value calculation, and can adjust for implausibly small variance values [1].

Parameters
Xarray

Array to return t-values for.

sigmafloat

The variance estate will be given by “var + sigma * max(var)” or “var + sigma”, depending on “method”. By default this is 0 (no adjustment). See Notes for details.

methodstr

If ‘relative’, the minimum variance estimate will be sigma * max(var), if ‘absolute’ the minimum variance estimate will be sigma.

Returns
tarray

t-values, potentially adjusted using the hat method.

Notes

To use the “hat” adjustment method [1], a value of sigma=1e-3 may be a reasonable choice.

You can use the conversion from scipy.stats.distributions.t.ppf:

thresh = -scipy.stats.distributions.t.ppf(p_thresh, n_samples - 1) / 2.

to convert a desired p-value threshold to 2-tailed t-value threshold. For one-tailed tests, thresh in the above should be multiplied by 2 (and for tail=-1, multiplied by -1).

References

1(1,2)

Ridgway et al. 2012 “The problem of low variance voxels in statistical parametric mapping; a new hat avoids a ‘haircut’”, NeuroImage. 2012 Feb 1;59(3):2131-41.

Examples using mne.stats.ttest_1samp_no_p