help grubbs -------------------------------------------------------------------------------

Title

grubbs -- Performs Grubbs' test for outliers

Syntax

grubbs varlist [if] [in] [, options]

options Description ------------------------------------------------------------------------- Procedure iter(#) perform maximum of # iterations; default is iter(16000) level(#) set confidence level; default is level(95)

Output drop drop out of the sample observations that are outliers generate(newvar1 ...) Variable(s) to be created, containing 1 if the observation is an outlier

Reporting log display an iteration log; default is no log. -------------------------------------------------------------------------

Description

grubbs test (Grubbs, 1969 and Stefansky, 1972) can be used to detect outliers in a data set, either creating a new variable (equal to 1 if the observation is an outlier and 0 otherwise) or dropping outliers out of the data set. The Grubbs test is also known as the maximum normed residual test. The Grubbs test detects one outlier at each iteration. The outlier is expunged from the data set and the test is iterated until no outliers remain.

Options

+-----------+ ----+ Procedure +--------------------------------------------------------

iter(#) set maximum number of iterations; default is iter(16000).

level(#) set confidence level; default is level(95).

+--------+ ----+ Output +-----------------------------------------------------------

drop drop out of the sample the observations that are outliers in the Grubbs sense (not to be used in conjunction with generate).

generate(newvar1 newvar2 ...) create new Variables (newvar1 newvar2 ...), containing 1 if the observation is an outlier in the Grubbs sense and 0 otherwise. If no generate option is specified or if the number of new variable names does not match, default variable names will be used.

+-----------+ ----+ Reporting +--------------------------------------------------------

log display an iteration log; default is no log.

Examples

. sysuse auto.dta

. grubbs price mpg

. grubbs price mpg, gen(gr_pr gr_mpg) log drop iter(1000) level(90)

. grubbs price mpg, log gen(gru_pr gru_mpg) . list if gru_pr . reg price mpg if ~gru_pr & ~gru_mpg

Author

Nicolas Couderc, Reims Management School and Université Paris 1 (Panthéon - Sorbonne), couderc@univ-paris1.fr

Questions, comments and bug reports are welcome.

References

Grubbs F. (1969), Procedures for Detecting Outlying Observations in Samples, Te > chnometrics, 11(1), 1-21. Stefansky W. (1972), Rejecting Outliers in Factorial Designs, Technometrics, 14 > , 469-479.

Acknowledgements

This program owes a debt to Anne-Célia Disdier and Keith Head for the original Grubbs procedure implementation in Stata (available at http://strategy.sauder.ubc.ca/head/grubbs.ado) and to hadimvo.

Also see

On-line: help for hadimvo.