scipy.stats.mstats.

ttest_rel#

scipy.stats.mstats.ttest_rel(a, b, axis=0, alternative='two-sided')[source]#

Calculates the T-test on TWO RELATED samples of scores, a and b.

Deprecated since version 2.0.0: scipy.stats.mstats.ttest_rel is deprecated as of SciPy 2.0.0 and will be removed, along with the scipy.stats.mstats namespace, in SciPy 2.4.0. For similar functionality, use scipy.stats.ttest_rel with MArray(s) instead of NumPy masked array(s).

Parameters:
a, barray_like

The arrays must have the same shape.

axisint or None, optional

Axis along which to compute test. If None, compute over the whole arrays, a, and b.

alternative{‘two-sided’, ‘less’, ‘greater’}, optional

Defines the alternative hypothesis. The following options are available (default is ‘two-sided’):

  • ‘two-sided’: the means of the distributions underlying the samples are unequal.

  • ‘less’: the mean of the distribution underlying the first sample is less than the mean of the distribution underlying the second sample.

  • ‘greater’: the mean of the distribution underlying the first sample is greater than the mean of the distribution underlying the second sample.

Added in version 1.7.0.

Returns:
statisticfloat or array

t-statistic

pvaluefloat or array

two-tailed p-value

Notes

For more details on ttest_rel, see scipy.stats.ttest_rel.