grubbs.test: Test for Outlier

View source: R/grubbs.test.R

grubbs.testR Documentation

Test for Outlier

Description

Tests for a single outlier in a sample from a normal distribution.

Usage

grubbs.test(x, alternate = "two.sided")

Arguments

x

a vector of numeric values. Missing values are allowed, but are ignored in the calculation.

alternate

the alternate hypothesis; must be "two.sided" for either a high or a low outlier, "high" to test only for a high outlier, or "low" to test only for a lopw outlier.

Value

An object of class "htest" having the following components:

statistic

the value of the test statistic.

p.value

the attained p-value for the test.

data.name

a character string describing the name of the data used in the test.

alternative

a description of the altrnative and null hypotheses.

method

a description of the method.

References

Grubbs, F., 1969, Procedures for Detecting Outlying Observations in Samples, Technometrics, v. 11, no. 1, pp. 1-21.

See Also

pgrubbs, qgrubbs

Examples

# A random sample with a high value
set.seed(100)
grubbstest <- rnorm(32)
grubbs.test(grubbstest)
qqnorm(grubbstest)

USGS-R/smwrStats documentation built on Oct. 11, 2022, 6:15 a.m.