dixonTest (version 1.0.4)

Dixon: Dixon distribution

Description

Density, distribution function, quantile function and random generation for Dixon's ratio statistics \(r_{j,i-1}\) for outlier detection.

Usage

qdixon(p, n, i = 1, j = 1, log.p = FALSE, lower.tail = TRUE)

pdixon(q, n, i = 1, j = 1, lower.tail = TRUE, log.p = FALSE)

ddixon(x, n, i = 1, j = 1, log = FALSE)

rdixon(n, i = 1, j = 1)

Value

ddixon gives the density function, pdixon gives the distribution function, qdixon gives the quantile function and rdixon generates random deviates.

Arguments

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required

i

number of observations <= x_i

j

number of observations >= x_j

log.p

logical; if TRUE propabilities p are given as log(p)

lower.tail

logical; if TRUE (default), probabilities are P[X <= x] otherwise, P[X > x].

q

vector of quantiles

x

vector of quantiles.

log

logical; if TRUE (default), probabilities p are given as log(p).

Details

According to McBane (2006) the density of the statistics \(r_{j,i-1}\) of Dixon can be yield if \(x\) and \(v\) are integrated over the range \((-\infty < x < \infty, 0 \le v < \infty)\)

$$ \begin{array}{lcl} f(r) & = & \frac{n!}{\left(i-1\right)! \left(n-j-i-1\right)!\left(j-1\right)!} \\ & & \times \int_{-\infty}^{\infty} \int_{0}^{\infty} \left[\int_{-\infty}^{x-v} \phi(t)dt\right]^{i-1} \left[\int_{x-v}^{x-rv} \phi(t)dt \right]^{n-j-i-1} \\ & & \times \left[\int_{x-rv}^x \phi(t)dt \right]^{j-1} \phi(x-v)\phi(x-rv)\phi(x)v ~ dv ~ dx \\ \end{array}$$ where \(v\) is the Jacobian and \(\phi(.)\) is the density of the standard normal distribution. McBane (2006) has proposed a numerical solution using Gaussian quadratures (Gauss-Hermite quadrature and half-range Hermite quadrature) and coded a library in Fortran. These R functions are wrapper functions to use the respective Fortran code.

References

Dixon, W. J. (1950) Analysis of extreme values. Ann. Math. Stat. 21, 488--506. tools:::Rd_expr_doi("10.1214/aoms/1177729747").

Dean, R. B., Dixon, W. J. (1951) Simplified statistics for small numbers of observation. Anal. Chem. 23, 636--638. tools:::Rd_expr_doi("10.1021/ac60052a025").

McBane, G. C. (2006) Programs to compute distribution functions and critical values for extreme value ratios for outlier detection. J. Stat. Soft. 16. tools:::Rd_expr_doi("10.18637/jss.v016.i03").

Examples

Run this code
set.seed(123)
n <- 20
Rdixon <- rdixon(n, i = 3, j = 2)
Rdixon
pdixon(Rdixon, n = n, i = 3, j = 2)
ddixon(Rdixon, n = n, i = 3, j = 2)

Run the code above in your browser using DataLab