get_critical_value#
- pycafee.normalitycheck.kolmogorovsmirnov.KolmogorovSmirnov.get_critical_value(self, n_rep, alfa=None)#
This function returns the critical value (tabulated) of the Kolmogorov Smirnov test.
- Parameters
- alfa
float The significance level (between
0.0and1.0, default =0.05)- n_rep
int The total number of observations (
n_rep >= 2).
- alfa
- Returns
- critical
floatorNone. The tabulated 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
For data with sample size between
21and24(20 < n_rep < 25), the critical value returned is the value for25observations;For data with sample size between
26and29(25 < n_rep < 30), the critical value returned is the value for30observations;For data with sample size between
31and34(30 < n_rep < 35), the critical value returned is the value for35observations;For data with a sample size higher than
36(n_rep > 35), the critical value returned is the aproximation proposed by the authors.
This function has tabulated values for the following confidence levels [1]:
99% (
ɑ = 0.01);95% (
ɑ = 0.05);90% (
ɑ = 0.10);85% (
ɑ = 0.15);80% (
ɑ = 0.20);
The function returns None for other confidence levels.
References
- 1
FRANK J. MASSEY, J. The Kolmogorov-Smirnov Test for Goodness of Fit. Journal of the American Statistical Association, v. 46, n. 253, p. 68–78, 1951. DOI: 10.2307/2280095.
Examples
Getting tabulated value for
5%of significance and5observations>>> from pycafee.normalitycheck.kolmogorovsmirnov import KolmogorovSmirnov >>> ks_test = KolmogorovSmirnov() >>> critical_value = ks_test.get_critical_value(n_rep=5) >>> print(critical_value) KolmogorovSmirnovResult(critical=0.565, alpha=0.05)
Getting tabulated value for
1%of significance and10observations>>> from pycafee.normalitycheck.kolmogorovsmirnov import KolmogorovSmirnov >>> ks_test = KolmogorovSmirnov() >>> critical_value = ks_test.get_critical_value(n_rep=10, alfa=0.01) >>> print(critical_value) KolmogorovSmirnovResult(tabulate=0.49, alpha=0.01)