Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

grubbsTest

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 X denote an identically and independently distributed continuous variate with realizations x_i ~~ (1 ≤ i ≤ k). Further, let the increasingly ordered realizations denote x_{(1)} ≤ x_{(2)} ≤ … ≤ x_{(n)}. Then the following model for a single maximum outlier can be proposed:

x[(i)] = μ + ε[(i)] for i = 1, ..., n - 1 and x[(i)] = μ + Δ + ε[(n)]

with ε \approx N(0,σ). The null hypothesis, H_0: Δ = 0 is tested against the alternative, H_{\mathrm{A}}: Δ > 0.

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

x[(i)] = μ + Δ + ε[(1)] and x[(i)] = μ + ε[(i)] for i = 2, ..., n

The null hypothesis is tested against the alternative, H_{\mathrm{A}}: Δ < 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")

PMCMRplus

Calculate Pairwise Multiple Comparisons of Mean Rank Sums Extended

v1.9.0
GPL (>= 3)
Authors
Thorsten Pohlert [aut, cre] (<https://orcid.org/0000-0003-3855-3025>)
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.