ttest_1samp

numeric.stats.ttest_1samp(a, popmean)

Calculate the T-test for the mean of ONE group of scores.

This is a two-sided test for the null hypothesis that the expected value (mean) of a sample of independent observations a is equal to the given population mean, popmean.

Parameters:
  • a – (array_like) Sample observation.
  • popmean – (float) Expected value in null hypothesis.
Returns:

t-statistic and p-value

Examples:

from mipylib.numeric import stats

a = array([1,2,-1,2,1,-4])
mu = 0
r = stats.ttest_1samp(a, mu)
print r

Result:

>>> run script...
(0.17622684421256019, 0.8670310908282268)