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_repint

The total number of observations (n_rep >= 3, vary).

ratiostr, optional

The ratio. It can be "r10" (or None), "r11", "r12", "r20", "r21" or "r22".

alfafloat

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

Returns
resulttuple with:
criticalfloat

The critical value.

alfafloat

The corresponding significance level.

Notes

There are critical values for confidence levels of 0.20, 0.10, 0.05, 0.04, 0.02 and 0.01, which also depend on the ratio parameter and the sample size (n_rep):

  • For ratio="r10" there are critical values within this range 3<=n_rep<=30;

  • For ratio="r11" there are critical values within this range 4<=n_rep<=30;

  • For ratio="r12" there are critical values within this range 5<=n_rep<=30;

  • For ratio="r20" there are critical values within this range 4<=n_rep<=30;

  • For ratio="r21" there are critical values within this range 5<=n_rep<=30;

  • For ratio="r22" there are critical values within this range 6<=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)