grubbs.test {envoutliers}R Documentation

Outlier detection using Grubbs test - Only intended for developer use

Description

Sequential identification of outliers using Grubbs' test. The algorithm first considers the data value with the highest absolute value. If the null hypothesis that such a value is not an outlier is rejected, the considered value is detected as an outlier and excluded from further analysis. Subsequently, a value with the second-highest absolute value is considered, and its quality is again evaluated using the Grubbs test. This procedure is repeated until no outlier is detected. The function is called by KRDetect.outliers.changepoint and grubbs.detect. The function is not intended for use by regular users of the package.

Usage

grubbs.test(x, alpha = 0.05)

Arguments

x

a numeric vector of data values.

alpha

a numeric value giving test significance level.

Details

This function sequentially identifies outlier data using Grubbs test. The function is exported for developer use only. It does not perform any checks on inputs since it is only convenience function for identification of outlier residuals using Grubbs test.

Value

A list is returned with elements:

result

A table containing information about identified outliers. The number of rows of the table corresponds to the number of identified outliers. The table has following columns: index - a numeric value giving the index of detected outlier in the original data, value - a numeric value of the identified outlier, test.value - a numeric value of the test statistics, critical.value - a numeric value giving the test statistics, p.value - a numeric value giving p.value of the test

outliers.exists

A logical value. TRUE means that at least one outlier was detected.

References

Grubbs F (1950). Sample criteria for testing outlying observations. The Annals of Mathematical Statistics, 21(1), 27-58.


[Package envoutliers version 1.1.0 Index]