dist_plot#
- normtest.ryan_joiner.dist_plot(axes, critical_range=(4, 50), test=None)[source]#
This function generates axis with critical data from the Ryan-Joiner Normality test [1].
- 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).
- testtuple (optional), with two elements:
- statisticfloat (positive)
The test statistic;
- sample_sizeint
The axis of the graph;
- Returns:
- axesmatplotlib.axes.SubplotBase
The axis of the graph;
See also
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 ryan_joiner >>> import matplotlib.pyplot as plt >>> from scipy import stats >>> data = stats.norm.rvs(loc=0, scale=1, size=30, random_state=42)
Apply the Ryan Joiner test
>>> result = ryan_joiner.rj_test(data)
Create the distribution graph using the test result
>>> fig, ax = plt.subplots(figsize=(6, 4)) >>> ryan_joiner.dist_plot(axes=ax, test=(result.statistic, data.size)) >>> # plt.savefig("rj_dist_plot.png") >>> plt.show()