grubbsTest {PMCMRplus}R Documentation

Grubbs Outlier Test

Description

Performs Grubbs single outlier test.

Usage

grubbsTest(x, alternative = c("two.sided", "greater", "less"))

Arguments

x

a numeric vector of data.

alternative

the alternative hypothesis. Defaults to "two.sided".

Details

Let XX denote an identically and independently distributed continuous variate with realizations xi  (1ik)x_i ~~ (1 \le i \le k). Further, let the increasingly ordered realizations denote x(1)x(2)x(n)x_{(1)} \le x_{(2)} \le \ldots \le x_{(n)}. Then the following model for a single maximum outlier can be proposed:

x(i)={μ+ϵ(i),i=1,,n1μ+Δ+ϵ(n) x_{(i)} = \left\{ \begin{array}{lcl} \mu + \epsilon_{(i)}, & \qquad & i = 1, \ldots, n - 1 \\ \mu + \Delta + \epsilon_{(n)} & & \\ \end{array} \right.

with ϵN(0,σ)\epsilon \approx N(0,\sigma). The null hypothesis, H0:Δ=0_0: \Delta = 0 is tested against the alternative, HA:Δ>0_{\mathrm{A}}: \Delta > 0.

For testing a single minimum outlier, the model can be proposed as

x(i)={μ+Δ+ϵ(1)μ+ϵ(i),i=2,,n x_{(i)} = \left\{ \begin{array}{lcl} \mu + \Delta + \epsilon_{(1)} & & \\ \mu + \epsilon_{(i)}, & \qquad & i = 2, \ldots, n \\ \end{array} \right.

The null hypothesis is tested against the alternative, HA:Δ<0_{\mathrm{A}}: \Delta < 0.

The p-value is computed with the function pgrubbs.

Value

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.

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.. doi:10.1007/s10182-011-0185-y.

Examples

data(Pentosan)
dat <- subset(Pentosan, subset = (material == "A"))
labMeans <- tapply(dat$value, dat$lab, mean)
grubbsTest(x = labMeans, alternative = "two.sided")

[Package PMCMRplus version 1.9.10 Index]