get_critical_value#
- pycafee.sample.outliers.Dixon.get_critical_value(self, n_rep, ratio=None, alfa=None)#
This function returns the critical value (tabulated) of the Dixon test for outlier detection [1]. The critical values are the values given by Rorabacher [2] for the two-tailed distribution.
- Parameters
- n_rep
int The total number of observations (
n_rep >= 3, vary).- ratio
str, optional The ratio. It can be
"r10"(orNone),"r11","r12","r20","r21"or"r22".- alfa
float The significance level (between
0.0and1.0, default =0.05)
- n_rep
- Returns
- result
tuplewith: - critical
float The critical value.
- alfa
float The corresponding significance level.
- critical
- result
Notes
There are critical values for confidence levels of
0.20,0.10,0.05,0.04,0.02and0.01, which also depend on theratioparameter and the sample size (n_rep):For
ratio="r10"there are critical values within this range3<=n_rep<=30;For
ratio="r11"there are critical values within this range4<=n_rep<=30;For
ratio="r12"there are critical values within this range5<=n_rep<=30;For
ratio="r20"there are critical values within this range4<=n_rep<=30;For
ratio="r21"there are critical values within this range5<=n_rep<=30;For
ratio="r22"there are critical values within this range6<=n_rep<=30;
References
- 1
DIXON, W. J. Processing Data for Outliers. Biometrics, v. 9, n. 1, p. 74–89, 1953.
- 2
RORABACHER, D. B. Statistical Treatment for Rejection of Deviant Values: Critical Values of Dixon’s “Q” Parameter and Related Subrange Ratios at the 95% Confidence Level. v. 63, n. 2, p. 139–146, 1991.
Examples
>>> from pycafee.sample.dixon import Dixon >>> outliers = Dixon() >>> result = outliers.get_critical_value(7) >>> print(result) DixonResult(critical=0.568, alpha=0.05)
>>> from pycafee.sample.dixon import Dixon >>> outliers = Dixon() >>> result = outliers.get_critical_value(7, alfa=0.01) >>> print(result) DixonResult(critical=0.51, alpha=0.01)
>>> from pycafee.sample.dixon import Dixon >>> outliers = Dixon() >>> result = outliers.get_critical_value(7, ratio="r11") >>> print(result) DixonResult(critical=0.673, alpha=0.05)