test#

normtest.looney_gulledge.test(x_data, alpha=0.05, weighted=False)[source]#

This function applies the Looney-Gulledge Normality test [1].

Parameters:
x_datanumpy array

One dimension numpy array with at least 4 observations.

alphafloat, optional

The level of significance (\(\alpha\)). Default is 0.05;

weightedbool, optional

Whether to estimate the Normal order considering the repeats as its average (True) or not (False, default). Only has an effect if the dataset contains repeated values;

Returns:
resulttuple with
statisticfloat (positive)

The test statistic;

critical

The critical value of the test;

p_valuefloat or str

The probability of the test;

conclusionstr

The test conclusion (e.g, Normal/Not Normal).

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 and \(s^{2}\) is the sample variance.

The correlation is estimated using _statistic().

The Normality test has the following assumptions:

☕

\(H_0:\) Data was sampled from a Normal distribution.

\(H_1:\) The data was sampled from a distribution other than the Normal distribution.

The conclusion of the test is based on the comparison between the critical value (at \(\alpha\) significance level) and statistic of the test:

☕

if critical \(\leq\) statistic:

Fail to reject \(H_0:\) (e.g., data is Normal)

else:

Reject \(H_0:\) (e.g., data is not Normal)

The critical values are obtained using _critical_value().

Warning

The estimated \(p_{value}\) may not be accurate as it is calculated using linear interpolation

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
>>> from scipy import stats
>>> data = stats.norm.rvs(loc=0, scale=1, size=30, random_state=42)
>>> result = looney_gulledge.test(data)
>>> print(result)
LooneyGulledge(statistic=0.990439558451558, critical=0.964, p_value=0.7719779225778982, conclusion='Fail to reject Hâ‚€')