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
alfafloat

The significance level (between 0.0 and 1.0, default = 0.05)

n_repint

The total number of observations (n_rep >= 2).

Returns
criticalfloat or None.

The tabulated value for the requested confidence level.

alfafloat

The corresponding significance level

See also

draw_critical_values

Draws a plot with the critical values for several alpha values.

fit

performs the Kolmogorov Smirnov Normality test.

Notes

  • For data with sample size between 21 and 24 (20 < n_rep < 25), the critical value returned is the value for 25 observations;

  • For data with sample size between 26 and 29 (25 < n_rep < 30), the critical value returned is the value for 30 observations;

  • For data with sample size between 31 and 34 (30 < n_rep < 35), the critical value returned is the value for 35 observations;

  • 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 and 5 observations

>>> 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 and 10 observations

>>> 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)