get_critical_value#
- pycafee.sample.outliers.Grubbs.get_critical_value(self, n_rep, kind=None, alfa=None)#
This function returns the critical value for the Grubbs [1] test.
- Parameters
- n_rep
int The total number of observations (
3 <= n_rep <= 30, vary).- kind
str, optional The type of the test.
If
kind="one"(orNone), the function returns the critical value for \(G^{'}\)If
kind="two", the function returns the critical value for \(G^{''}\)If
kind="three", the function returns the critical value for \(G^{'''}\)
- alfa
float The significance level (
0.10,0.05(default) or0.01)
- n_rep
- Returns
- result
tuplewith: - critical
float The critical value.
- alfa
float The corresponding significance level.
- critical
- result
Notes
For \(G^{'}\) (
kind="one") the critical values are limited for sample sizes between3and30. For larger sample size, check [2]For \(G^{''}\) (
kind="two") the critical values are limited for sample sizes between3and20. For larger sample size, check [3].For \(G^{'''}\) (
kind="three") the critical values are limited for sample sizes between4and30. For larger sample size, check [2].References
- 1
GRUBBS, F. E. Sample Criteria for Testing Outlying Observations. The Annals of Mathematical Statistics, v. 21, n. 1, p. 27–58, 1950.
- 2(1,2)
GRUBBS, F. E.; BECK, G. Extension of Sample Sizes and Percentage Points for Significance Tests of Outlying Observations. Technometrics, v. 14, n. 4, p. 847–854, 1972.
- 3
DAVID, H. A.; HARTLEY, H. O.; PEARSON, E. S. The Distribution of the Ratio, in a Single Normal Sample, of Range to Standard Deviation. Biometrika, v. 41, n. 3/4, p. 482–493, 1954.
Examples
Getting the critical value for 5 samples at 5% significance level for \(G^{'}\)
>>> from pycafee.sample.outliers import Grubbs >>> test = Grubbs() >>> result = test.get_critical_value(5) >>> print(result) GrubbsResult(Critical=1.715, alpha=0.05)
Getting the critical value for 5 samples at 5% significance level for \(G^{''}\)
>>> from pycafee.sample.outliers import Grubbs >>> test = Grubbs() >>> result = test.get_critical_value(5, kind="two") >>> print(result) GrubbsResult(Critical=2.753, alpha=0.05)
Getting the critical value for 5 samples at 5% significance level for \(G^{'''}\)
>>> from pycafee.sample.outliers import Grubbs >>> test = Grubbs() >>> result = test.get_critical_value(5, kind="three") >>> print(result) GrubbsResult(Critical=0.009, alpha=0.05)