RyanJoiner#
- class normtest.ryan_joiner.RyanJoiner(alpha=0.05, safe=True, cte_alpha='3/8', weighted=False, **kwargs)[source]#
This class instantiates an object to perform the Ryan-Joiner Normality test [1].
References
[1]RYAN, T. A., JOINER, B. L. Normal Probability Plots and Tests for Normality, Technical Report, Statistics Department, The Pennsylvania State University, 1976. Available at www.additive-net.de. Access on: 22 Jul. 2023.
Examples
>>> from normtest import RyanJoiner >>> import numpy as np >>> x = np.array([6, 1, -4, 8, -2, 5, 0]) >>> test = RyanJoiner() >>> test.fit(x) >>> print(test.normality) RyanJoiner(statistic=0.9844829186140105, critical=0.8977794003662074, p_value='p > 0.100', 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 Ryan-Joiner Normality test;
dist_plot(axes, alphas=[0.10, 0.05, 0.01]):
Generates axis with critical data from the Ryan-Joiner Normality test;
correlation_plot(axes)
Generates an axis with the Ryan-Joiner 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 Ryan-Joiner’s test reference;
- citation(export=False)[source]#
This method returns the reference from Ryan-Joiner’s test, with the option to export the reference in .bib format.
- Parameters:
- exportbool
Whether to export the reference as RyanJoiner1976.bib file (True) or not (False, default);
- Returns:
- referencestr
The Ryan-Joiner Test reference;
- correlation_plot(axes)[source]#
This method generates an axis with the correlation plotfor the Ryan-Joiner 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, critical_range=(4, 50))[source]#
This method generates an axis with the critical data from the Ryan-Joiner Normality test.
- Parameters:
- axesmatplotlib.axes.SubplotBase
The axis of the graph;
- critical_rangetuple (optional), with two elements:
- x_minint, optional
The lower range of the number of observations for the critical values (default is
4).- x_maxint, optional
The upper range of the number of observations for the critical values (default is
50).
- Returns:
- axesmatplotlib.axes.SubplotBase
The axis of the graph;
See also
- fit(x_data)[source]#
This method applies the Ryan-Joiner 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);