This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / stats / _mstats_basic / ttest_rel

function

scipy.stats._mstats_basic:ttest_rel

source: build-install/usr/lib/python3.14/site-packages/scipy/stats/_mstats_basic.py:1754

Signature

def ttest_rel(a, b, axis = 0, alternative = two-sided)

Summary

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

Parameters

a, b : array_like

The arrays must have the same shape.

axis : int 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.

Returns

statistic : float or array

t-statistic

pvalue : float or array

two-tailed p-value

Notes

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

Aliases

  • scipy.stats._mstats_basic.ttest_rel