Grubbs Double Outlier Test
Performs Grubbs double outlier test.
doubleGrubbsTest(x, alternative = c("two.sided", "greater", "less"), m = 10000)
Arguments
x
: a numeric vector of data.
alternative
: the alternative hypothesis. Defaults to "two.sided"
.
m
: number of Monte-Carlo replicates.
Returns
A list with class "htest"
containing the following components:
- method: a character string indicating what type of test was performed.
- data.name: a character string giving the name(s) of the data.
- statistic: the estimated quantile of the test statistic.
- p.value: the p-value for the test.
- parameter: the parameters of the test statistic, if any.
- alternative: a character string describing the alternative hypothesis.
- estimates: the estimates, if any.
- null.value: the estimate under the null hypothesis, if any.
Details
Let X denote an identically and independently distributed continuous variate with realizations xi (1≤i≤k). Further, let the increasingly ordered realizations denote x(1)≤x(2)≤…≤x(n). Then the following model for testing two maximum outliers can be proposed:
x(i)={μ+ϵ(i),μ+Δ+ϵ(j)i=1,…,n−2j=n−1,n
with ϵ≈N(0,σ). The null hypothesis, H0:Δ=0 is tested against the alternative, HA:Δ>0.
For testing two minimum outliers, the model can be proposed as
x(i)={μ+Δ+ϵ(j)μ+ϵ(i),j=1,2i=3,…,n
The null hypothesis is tested against the alternative, HA:Δ<0.
The p-value is computed with the function pdgrubbs
.
Examples
data(Pentosan)
dat <- subset(Pentosan, subset = (material == "A"))
labMeans <- tapply(dat$value, dat$lab, mean)
doubleGrubbsTest(x = labMeans, alternative = "less")
References
Grubbs, F. E. (1950) Sample criteria for testing outlying observations. Ann. Math. Stat. 21 , 27--58.
Wilrich, P.-T. (2011) Critical values of Mandel's h and k, Grubbs and the Cochran test statistic. Adv. Stat. Anal.. tools:::Rd_expr_doi("10.1007/s10182-011-0185-y") .