grubbs.test: Outlier detection using Grubbs test - Only intended for...

Description Usage Arguments Details Value References

View source: R/changepoint.R


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.


grubbs.test(x, alpha = 0.05)



a numeric vector of data values.


a numeric value giving test significance level.


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.


A list is returned with elements:


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


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


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

envoutliers documentation built on July 2, 2020, 3:25 a.m.