statsmodels.stats.weightstats._zstat_generic2(value, std, alternative)[source]

generic (normal) z-test based on summary statistic

The test statistic is :

zstat = value / std

and is assumed to be normally distributed with standard deviation std.

valuefloat or ndarray

Value of a sample statistic, for example mean.

value2float or ndarray

Value, for example mean, of the second sample.

stdfloat or ndarray

Standard error of the sample statistic value.


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

  • ‘two-sided’ : H1: value1 - value2 - diff not equal to 0.

  • ‘larger’ : H1: value1 - value2 - diff > 0

  • ‘smaller’ : H1: value1 - value2 - diff < 0

zstatfloat or ndarray

Test statistic.

pvaluefloat or ndarray

P-value of the hypothesis test assuming that the test statistic is normally distributed.

Last update: Jul 16, 2024