statsmodels.stats.weightstats.DescrStatsW.ttest_mean

DescrStatsW.ttest_mean(value=0, alternative='two-sided')[source]

ttest of Null hypothesis that mean is equal to value.

The alternative hypothesis H1 is defined by the following

  • ‘two-sided’: H1: mean not equal to value

  • ‘larger’ : H1: mean larger than value

  • ‘smaller’ : H1: mean smaller than value

Parameters
valuefloat or array

the hypothesized value for the mean

alternativestr

The alternative hypothesis, H1, has to be one of the following:

  • ‘two-sided’: H1: mean not equal to value (default)

  • ‘larger’ : H1: mean larger than value

  • ‘smaller’ : H1: mean smaller than value

Returns
tstatfloat

test statistic

pvaluefloat

pvalue of the t-test

dfint or float