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:
  • value (float or ndarray) – Value of a sample statistic, for example mean.

  • value2 (float or ndarray) – Value, for example mean, of the second sample.

  • std (float or ndarray) – Standard error of the sample statistic value.

  • alternative (str) –

    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:

  • zstat (float or ndarray) – Test statistic.

  • pvalue (float or ndarray) – P-value of the hypothesis test assuming that the test statistic is normally distributed.