get_critical_value#
- pycafee.normalitycheck.shapirowilk.ShapiroWilk.get_critical_value(self, n_rep, alfa=None)#
This function returns the critical value (tabulated) of the Shapiro Wilk [1] test.
- Parameters
- alfa
float The significance level (between
0.0and1.0, default =0.05)- n_rep
int The total number of observations (
n_rep >= 3).
- alfa
- Returns
- critical
floatorNone. The critical value for the requested confidence level.
- alfa
float The corresponding significance level
- critical
See also
draw_critical_valuesDraws a plot with the critical values for several alpha values.
fitperforms the Kolmogorov Smirnov Normality test.
Notes
The critical value is returned only if the number of observations is at least
3(n_rep >= 3).If the number of repetitions is higher than
50(n_rep > 50), the function returns the tabulated value for50(n_rep = 50) observations.This function has tabulated values for the following confidence levels [1]:
99% (ɑ = 0.01);
98% (ɑ = 0.02);
95% (ɑ = 0.05);
90% (ɑ = 0.10);
50% (ɑ = 0.50);
The function returns
Nonefor other confidence levels.References
- 1(1,2)
SHAPIRO, S. S.; WILK, M. B. An Analysis of Variance Test for Normality (Complete Samples). Biometrika, v. 52, n. 3, p. 591–611, 1965. DOI: 10.2307/2333709.
Examples
Getting tabulated value for
5%of significance and5observations>>> from pycafee.normalitycheck.shapirowilk import ShapiroWilk >>> sw_test = ShapiroWilk() >>> critical_value = sw_test.get_critical_value(n_rep=5) >>> print(critical_value) ShapiroWilkResult(critical=0.762, alpha=0.05)
Getting tabulated value for
1%of significance and10observations>>> from pycafee.normalitycheck.shapirowilk import ShapiroWilk >>> sw_test = ShapiroWilk() >>> critical_value = sw_test.get_critical_value(n_rep=10, alfa=0.01) >>> print(critical_value) ShapiroWilkResult(critical=0.781, alpha=0.01)