_statistic#

normtest.looney_gulledge._statistic(x_data, zi)[source]#

This function estimates the Looney-Gulledge test statistic [1].

Parameters:
x_datanumpy array

One dimension numpy array with at least 4 observations.

zinumpy array

The statistical order in the standard Normal distribution scale.

Returns:
statisticfloat (positive)

The test statistic;

Notes

The test statistic (\(R_{p}\)) is estimated through the correlation between the ordered data and the Normal statistical order:

\[R_{p}=\dfrac{\sum_{i=1}^{n}x_{(i)}z_{(i)}}{\sqrt{s^{2}(n-1)\sum_{i=1}^{n}z_{(i)}^2}}\]

where \(z_{(i)}\) values are the z-score values of the corresponding experimental data (\(x_{({i)}}\)) value, \(n\) is the sample size and \(s^{2}\) is the sample variance.

The correlation is estimated using scipy.stats.pearsonr().

References

[1]

LOONEY, S. W.; GULLEDGE, T. R. Use of the Correlation Coefficient with Normal Probability Plots. The American Statistician, v. 39, n. 1, p. 75-79, fev. 1985.

Examples

>>> from normtest import looney_gulledge
>>> import numpy as np
>>> x_data = np.array([148, 148, 154, 158, 158, 160, 161, 162, 166, 170, 182, 195, 210])
>>> x_data = np.sort(x_data)
>>> normal_order = looney_gulledge._normal_order_statistic(x_data)
>>> result = looney_gulledge._statistic(x_data, normal_order)
>>> print(result)
0.9225156050800545