LooneyGulledge#
- class normtest.looney_gulledge.LooneyGulledge(alpha=0.05, safe=True, weighted=False, **kwargs)[source]#
This class instantiates an object to perform the Looney-Gulledge Normality test [1].
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 LooneyGulledge >>> import numpy as np >>> x = np.array([6, 1, -4, 8, -2, 5, 0]) >>> test = LooneyGulledge() >>> test.fit(x) >>> print(test.normality) LooneyGulledge(statistic=0.9844829186140105, critical=0.898, p_value=0.8715547240126971, conclusion='Fail to reject H₀')
- Attributes:
- statisticfloat (positive)
The test statistic;
- criticalfloat
The critical value of the test;
- p_valuefloat or str
The probability of the test;
- conclusionstr
The test conclusion (e.g, Normal/Not Normal).
- alphafloat, optional
The level of significance (\(\alpha\)). Default is
0.05;- normalitynamed tuple
A tuple with the main test results summarized
- normality_hypothesisstr
Description of the Normality test
- safebool, optional
Whether to check the inputs before performing the calculations (True, default) or not (False). Useful for beginners to identify problems in data entry (may reduce algorithm execution time);
Methods
fit(x_data)
Applies the Looney-Gulledge Normality test;
dist_plot(axes, alphas=[0.10, 0.05, 0.01]):
Generates axis with critical data from the Looney-Gulledge Normality test;
correlation_plot(axes)
Generates an axis with the Looney-Gulledge test correlation graph;
line_up(seed=None, correct=False)
Generates a Figure with the correlation graphs for the line up method;
citation(export=False)
Returns the Looney-Gulledge’s test reference;
- citation(export=False)[source]#
This method returns the reference from Looney-Gulledge’s test, with the option to export the reference in .bib format.
- Parameters:
- exportbool
Whether to export the reference as LooneyGulledge1985.bib file (True) or not (False, default);
- Returns:
- referencestr
The Looney-Gulledge test reference;
- correlation_plot(axes)[source]#
This method generates an axis with the correlation plotfor the Looney-Gulledge Normality test.
- Parameters:
- axesmatplotlib.axes.SubplotBase
The axis of the graph;
- Returns:
- axesmatplotlib.axes.SubplotBase
The axis of the graph;
See also
- dist_plot(axes, alphas=[0.1, 0.05, 0.01])[source]#
This method generates an axis with critical data from the Looney-Gulledge Normality test.
- Parameters:
- axesmatplotlib.axes.SubplotBase
The axis of the graph;
- alphaslist of floats, optional
The significance level (\(\alpha\)) to draw the critical lines. Default is [0.10, 0.05, 0.01];
- Returns:
- axesmatplotlib.axes.SubplotBase
The axis of the graph;
See also
- fit(x_data)[source]#
This method applies the Looney-Gulledge test.
- Parameters:
- x_datanumpy array
One dimension numpy array with at least
4observations.
- Returns:
- x_datanumpy array
One dimension numpy array with at least
4observations.- statisticfloat (positive)
The test statistic;
- criticalfloat
The critical value of the test;
- p_valuefloat or str
The probability of the test;
- conclusionstr
The test conclusion (e.g, Normal/Not Normal).
- normalitynamed tuple
A tuple with the main test results summarized
See also
- get_alpha()#
Returns the current alpha value
- Returns:
- alphafloat
The level of significance (\(\alpha\)).
- get_safe()#
Returns the current status of parameter safe
- Returns:
- safebool, optional
Whether to check the inputs before performing the calculations (True, default) or not (False). Useful for beginners to identify problems in data entry (may reduce algorithm execution time);
- line_up(seed=None, correct=False)[source]#
This method generates a Figure with the correlation graphs for the line up method.
- Parameters:
- seedint or None, optional
A numerical value that generates a new set or repeats pseudo-random numbers. Use a positive integer value to be able to repeat results. Default is
Nonewhat generates a random seed;- correctbool, optional
Whether the x_data is to be drawn in red (False) or black (True, default);
- Returns:
- figmatplotlib.figure.Figure
A figure with the generated graphics;
See also
- set_alpha(alpha)#
Changes the alpha value
- Parameters:
- alphafloat
The level of significance (\(\alpha\)).
Notes
This method only allows input of type float and between
0.0and1.0.
- set_safe(safe)#
Changes the current status of parameter safe
- Parameters:
- safebool, optional
Whether to check the inputs before performing the calculations (True, default) or not (False). Useful for beginners to identify problems in data entry (may reduce algorithm execution time);