statsmodels.stats.weightstats._zstat_generic2

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.

Parameters:
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.

alternativestr

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

Returns:
zstatfloat or ndarray

Test statistic.

pvaluefloat or ndarray

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


Last update: Oct 03, 2024