```help sregress
-------------------------------------------------------------------------------

Title

sregress --   S-robust regression

Syntax

sregress depvar [indepvars] [if] [in] [, option]

options                 Description
-------------------------------------------------------------------------

noconstant            suppress constant term
outlier               generate outlyingness measures
graph                 generate the outlier identification graphical
tool
replic                set the number of sub-sampling to consider

-------------------------------------------------------------------------

Description

sregress fits an S-estimator of regression of depvar on varlist.  An
S-estimator of regression is a robust fitting approach which minimizes a
(rho) function of the regression residuals which is even, non decreasing
for positive values and less increasing than the square function. The
function used here is a Tukey Biweight leading to a Guassian efficiency
of 28.7%

Options

+-------+
----+ Model +------------------------------------------------------------

noconstant; see [R] estimation options.

+-----------+
----+ Algorithm +--------------------------------------------------------

graph; Displays a graphic where outliers are flagged according to their
type.

outlier; Four outlyingness measures are calculated. The first (S_stdres)
contains the robust standardized residuals, the second (S_outlier)
flags outliers in the vertical dimension (i.e. observations
associated with robust standardized residual larger than 2.25), the
third (Robust_distance) contains robust distances and the fourth
(MCD_outlier) flags outliers in the horizontal dimension (i.e.
observations associated with robust distances larger than the 97.5th
percentile of a Chi-quared).

replic; The number of subsets associated to the underlying algorithm is
set by default using the formula
replic=log(1-0.99)/log(1-(1-0.2)^(p+1)) where p is the number of
explanatory variables. This can be changed using the replic option.

Saved results

sregress saves the following in e():

Scalars
e(scale)       robust residual scale
e(N)           number of observations
e(df_m)        model degrees of freedom
e(df_r)        residual degrees of freedom

Macros
e(cmd)         sregress
e(properties)  b V

Matrices
e(b)           coefficient vector
e(V)           variance-covariance matrix of the estimators

Functions
e(sample)      marks estimation sample

Examples

Setup
. webuse auto

Robust regression
. xi: sregress price mpg headroom trunk weight length turn
displacement gear_ratio i.rep78 foreign

Same as above, but asking for outlyingness measures
. xi: sregress price mpg headroom trunk weight length turn
displacement gear_ratio i.rep78 foreign, outliers

References

Dehon, C., Gassner, M. and Verardi, V. (2008), "Beware of "Good" Outliers
and Overoptimistic Conclusions", forthcoming in the Oxford Bulletin of
Economics and Statistics

Rousseeuw, P. J. and Yohai, V. (1987), "Robust Regression by Means of
S-estimators", in Robust and Nonlinear Time Series Analysis, edited by J.
Franke, W. Härdle and D. Martin, Lecture Notes in Statistics No. 26,
Springer Verlag, Berlin, pp. 256-272.

Rousseeuw, P. J. and van Zomeren, B. (1990), "Unmasking Multivariate
Outliers and Leverage Points", Journal of the American Statistical
Association, 85, pp. 633-639.

Salibian-Barrera, M. and Yohai, V. (2006). "A fast algorithm for
S-regression estimates". Journal of Computational and Graphical
Statistics, 15, 414-427.

Also see

Online:  [R] qreg, [R] regress;
[R] rreg, mmregress, mregress, msregress, mcd

```