Learn R Programming

outliers (version 0.14)

dixon.test: Dixon tests for outlier

Description

Performs several variants of Dixon test for detecting outlier in data sample.

Usage

dixon.test(x, type = 0, opposite = FALSE, two.sided = TRUE)

Arguments

x

a numeric vector for data values.

opposite

a logical indicating whether you want to check not the value with largest difference from the mean, but opposite (lowest, if most suspicious is highest etc.)

type

an integer specyfying the variant of test to be performed. Possible values are compliant with these given by Dixon (1950): 10, 11, 12, 20, 21. If this value is set to zero, a variant of the test is chosen according to sample size (10 for 3-7, 11 for 8-10, 21 for 11-13, 22 for 14 and more). The lowest or highest value is selected automatically, and can be reversed used opposite parameter.

two.sided

treat test as two-sided (default).

Value

A list with class htest containing the following components:

statistic

the value of Dixon Q-statistic.

p.value

the p-value for the test.

alternative

a character string describing the alternative hypothesis.

method

a character string indicating what type of test was performed.

data.name

name of the data argument.

Details

The p-value is calculating by interpolation using qdixon and qtable. According to Dixon (1951) conclusions, the critical values can be obtained numerically only for n=3. Other critical values are obtained by simulations, taken from original Dixon's paper, and regarding corrections given by Rorabacher (1991).

References

Dixon, W.J. (1950). Analysis of extreme values. Ann. Math. Stat. 21, 4, 488-506.

Dixon, W.J. (1951). Ratios involving extreme values. Ann. Math. Stat. 22, 1, 68-78.

Rorabacher, D.B. (1991). Statistical Treatment for Rejection of Deviant Values: Critical Values of Dixon Q Parameter and Related Subrange Ratios at the 95 percent Confidence Level. Anal. Chem. 83, 2, 139-146.

See Also

chisq.out.test, grubbs.test

Examples

Run this code
# NOT RUN {
set.seed(1234)
x = rnorm(10)
dixon.test(x)
dixon.test(x,opposite=TRUE)
dixon.test(x,type=10)

# }

Run the code above in your browser using DataLab