help robreghttp://github.com/benjann/robreg/

Title

robreg -- Robust regression

Contents

Syntax
Description
Options
Examples
Stored results
References
Author
Also see

Syntax

Estimation

robreg subcmd depvar [indepvars] [if] [in] [weight]
[, options ]

where subcmd is

ls least squares regression; equivalent to regress

q quantile regression; similar to qreg

m M regression

s S regression

mm MM regression

lts least trimmed squares regression

lqs least quantile of squares regression

lms least median of squares regression

indepvars may contain factor variables; see fvvarlist.

depvar and indepvars may contain time-series operators; see tsvarlist.

fweights and pweights are allowed; see weight.

The svy prefix is allowed with robreg ls, robreg q, and robreg m,
unless ivar() or absorb() is specified.

Refitting MM after robreg s or robreg mm

robreg mm [, mm_refit_options ]

Replaying results

robreg [, reporting_options ]

Hausman test between models

robreg hausman [model1 [model2]] [,
hausman_options ]

where model1 and model2 are names of stored estimates from
robreg (or . for the active estimates). Omitting model2
is only allowed if applying robreg hausman to a model obtained
by robreg mm (the active estimates will be used if model1 is also
omitted).

Prediction

predict [type]
{newvar |
stub* |
newvar1 newvar2 ...} [if] [in]
[, predict_options ]

options description

Main
noconstant suppress constant term

nor2 do not compute the (pseudo) R-squared

Subcommand
ls_options additional options for robreg ls

q_options additional options for robreg q

m_options additional options for robreg m

s_options additional options for robreg s

mm_options additional options for robreg mm

lts_options additional options for robreg lts

lqs/lms_options additional options for robreg lqs/lms

VCE/SE
vce(vcetype) variance estimation method;
vcetype may be robust, cluster clustvar,
bootstrap, or jackknife

cluster(clustvar) synonym for
vce(cluster clustvar)

ftest report F tests rather then Wald tests

nose do not compute standard errors

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

noheader suppress table header

notable suppress table of results

all report results from all equations (relevant for robreg s and robreg mm)

display_options standard
reporting options as described in
[R] estimation options

Optimization
tolerance(#) tolerance for iterative algorithms

iterate(#) maximum number of iterations

relax do not return error if convergence is not reached

noquad do not use quad precision when taking cross products

nolog do not display progress information

ls_options description

fe_options fixed-effects options

q_options description

Main
quantile(#) estimate # quantile; the default is 0.5 (LAD or median regression)

VCE/SE
fitted alternative approach to estimate the sparsity function

bofinger use Bofinger's bandwidth rather than the Hall-Sheather bandwidth

Starting values
init(matname) use custom starting values

m_options description

Main
huber use Huber objective function; the default

biweight use biweight objective function

bisquare synonym for biweight

efficiency(#) gaussian efficiency, in percent;
default is efficiency(95)

k(#) tuning constant; alternative to efficiency()

fe_options fixed-effects options

Scale
scale(#) provide custom (starting) value for scale

updatescale update scale in each iteration

center center residuals when computing scale

Starting values
init(arg) set the starting values;
default is init(lad)

s_options description

Main
bp(#) breakdown point, in percent; default is bp(50)

k(#) tuning constant; alternative to bp()

nohausman do not compute Hausman test of S against LS

m(varlist [, opts]) variables
to be partialled out in the subsampling algorithm

fe_options fixed-effects options

Subsampling algorithm
nsamp(args) number of trial samples; args may be #
or alpha [epsilon]

rsteps(#) number of local improvement steps; default
is rsteps(2)

nkeep(#) number of candidates to be kept for final refinement; default
is nkeep(5)

naive use naive subsampling algorithm

alt use alternative nonsingular subsampling algorithm

nostd do not standardize the data (not recommended)

mm_options description

Main
efficiency(#) gaussian efficiency, in percent; default
is efficiency(85)

k(#) tuning constant; alternative to efficiency()

nohausman do not compute Hausman test of MM against S

S estimate
bp(#) breakdown point, in percent; default is bp(50)

sopts(options) other options passed through to the S algorithm

lts_options description

Main
bp(#) breakdown point, in percent; default is bp(50)

Subsampling algorithm
nsamp(args) number of trial samples; args may be #
or alpha [epsilon]

csteps(#) number of concentration steps; default
is csteps(2)

nkeep(#) number of candidates to be kept for final refinement; default
is nkeep(10)

naive use naive subsampling algorithm

alt use alternative nonsingular subsampling algorithm

nostd do not standardize the data (not recommended)

lqs/lms_options description

Main
bp(#) breakdown point, in percent (only allowed with robreg lqs)

Subsampling algorithm
nsamp(args) number of trial samples; args may be #
or alpha [epsilon]

naive use naive subsampling algorithm

alt use alternative nonsingular subsampling algorithm

nostd do not standardize the data (not recommended)

fe_options description

ivar(varname) variable identifying the groups; VCE like xtreg,fe

absorb(varname) variable identifying the groups; VCE like areg

[no]usave whether to store fixed effects in e()

ugenerate(newvar) store fixed effects as a variable, rather than in e()

replace allow overwriting existing variable

mm_refit_options description

efficiency(#) gaussian efficiency, in percent; default
is efficiency(85)

k(#) tuning constant; alternative to efficiency()

nohausman do not compute Hausman test of MM against S

ftest report F test rather then Wald test

reporting_options reporting options

optimization_options optimization options

hausman_options description

constant include constant in the test

common restrict the test to coefficients that exist in both models

keep(names) coefficients to be included; may use * and ? wildcards

drop(names) coefficients to be excluded; may use * and ? wildcards

ftest report F test rather then Wald test

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

noheader suppress header containing the overall test

notable suppress table containing tests by individual coefficients

display_options standard
reporting options as described in
[R] estimation options

post post results in e()

predict_options description

xb linear prediction

* xbu linear prediction plus fixed effect

* u fixed effect

* ue fixed effect plus residual

residuals residuals

rstandard standardized residuals

outlier[(#)] outlier indicator

inlier[(#)] inlier indicator

§ weights RLS weight

# subset H-subset indicator

+ scores equation-level scores

+ ifs coefficient-level influence functions

+ rifs recentered influence functions

* only after robreg ls, m, or s with option ivar() or absorb()

§ only after robreg m, s, or mm

# only after robreg lts, lqs, or lms

+ only after robreg ls, q, m, s, or mm

Description

robreg provides a number of robust estimators for linear
regression models (see, e.g., Maronna et al. 2006 for an overview of robust
regression estimators).

robreg ls fits classical (non-robust) least-squared models. Results
are equivalent to results from official regress (with robust
standard errors).

robreg q fits quantile regression models (median or LAD regression by default)
using the interior point algorithm (Portnoy and Koenker 1997). robreg q is similar
to official qreg.

robreg m fits M regression models (Huber 1973) using
iteratively reweighted least squares (IRLS).

robreg s fits high breakdown S regression models (Rousseeuw and Yohai
1984) based on random subsampling with local refinement
(Salibian-Barrera and Yohai 2006; employing fast nonsingular subsampling as
suggested by Koller 2012).

robreg mm fits MM regression models (Yohai 1987), combining an initial
high breakdown S estimator with a subsequent redescending M estimator.

robreg lts fits least trimmed squares (LTS) regression models
based on random subsampling with local concentration steps
(Rousseeuw and van Driessen 2002). Influence-function based variance
estimation is not supported by robreg lts.

robreg lqs and robreg lms fit least quantile of squares (LQS) and
least median of squares (LMS) regression models, respectively,
based on random subsampling (see Rousseeuw 1984,
Rousseeuw and Leroy 1987, Rousseeuw and Hubert 1997). Influence-function based variance
estimation is not supported by robreg lqs and robreg lms.

robreg hausman can be used after robreg ls, robreg q,
robreg m, robreg s, and robreg mm to perform
Hausman tests between models.

robreg requires moremata. See
ssc describe moremata.

Options

Main

noconstant suppresses the constant term (intercept) in the model. With
robust estimators, omitting the constant typically only makes sense if the specified
model is equivalent to a model including an intercept, for example, if the model contains
a factor variable without base level (see operator ibn. in help
fvvarlist).

Note that robreg always computes the R-squared with respect to a
constant-only model, even if option noconstant has been specified
(similar to regress with option tsscons).

nor2 skips the computation of the (pseudo) R-squared. Use this option to
save computer time.

Additional options for robreg ls

fe_options are options to include fixed-effects in the model; see
Fixed effects options below.

Additional options for robreg q

quantile(#) specifies the quantile to be estimated, with # as a proportion
between 0 and 1 (exclusive) (numbers between 1 and 100 will be interpreted as
percentages). The default is quantile(0.5) (LAD or median regression).

fitted computes the sparsity function (which is needed for variance
estimation) based on fitted values from auxiliary quantile regressions
(approach suggested by Hendricks and Koenker 1992). The default is to
compute the sparsity function based on nonparametric kernel density
estimation (using a gaussian kernel) (approach suggested by Powell 1991). Also
see Section 3.4.2 in Koenker (2005).

bofinger uses Bofinger's bandwidth for the estimation of the
sparsity function. The default is to use the Hall-Sheather bandwidth. See
Section 4.10.1 in Koenker (2005) for details. Note that the Hall-Sheather
bandwidth depends on the confidence level set by the level() option. For
the kernel-based approach (i.e. if fitted is not specified), the bandwidth
is further transformed as suggested by Koenker (2005, page 81).

init(matname) provides a matrix containing custom starting values.
Coefficients will be matched by name (starting values for coefficients
without match will be set to zero). If matname has multiple rows, the first row
will be used. The default is to obtain the starting values from a
least-squares fit. The choice of starting values should only affects the
number of iterations, but not the resulting estimates.

Additional options for robreg m

huber uses the Huber objective function (monotone M estimator). This
is the default.

biweight uses the biweight objective function
(redescending M estimator). bisquare is a synonym for
biweight. The solution of a redescending M estimator may depend on
the starting values.

efficiency(#) sets the gaussian efficiency (the asymptotic
relative efficiency compared to the LS or ML estimator in case of
i.i.d. normal errors), in percent. # must be between 63.7 and 99.9 for huber
and between 1 and 99.9 for biweight. The default is efficiency(95).

k(#) specifies a custom tuning constant. The default is to use a
tuning constant that is consistent with the requested gaussian
efficiency. k() and efficiency() are not both allowed.

fe_options are options to include fixed-effects in the model; see
Fixed effects options below.

scale(#) provides a custom (starting) value for the residual
scale. The default is to use the MADN (normalized median absolute deviation)
from the initial fit.

updatescale updates the scale in each iteration of the
IRLS algorithm. The default is to hold the scale fixed.

center uses median-centered residuals to compute the MADN. The default
is to use raw residuals.

init(arg) determines the starting values of the IRLS algorithm. arg
may be lad (median regression; the default) or ls (least-squares
regression). Furthermore, init(matname) may be specified, in which case
the starting values will be taken from the first row of matrix matname
(coefficients will be matched by name; starting values for coefficients
without match will be set to zero).

If option ivar() or absorb() is specified, the fixed-effects
(quasi) quantile estimator implemented in mm_aqreg() is used to
determine the lad starting values. Furthermore, init(matname)
is not allowed with ivar() or absorb().

Additional options for robreg s

bp(#) sets the breakdown point, in percent, with #
between 1 and 50. The default is bp(50).

k(#) specifies a custom tuning constant. The default is to use a
tuning constant that is consistent with the requested breakdown
point. k() and bp() are not both allowed.

nohausman suppresses the Hausman test of the S estimate against
the least-squares fit.

m(varlist [, options]) identifies outlier-free variables to be
partialled out when searching for candidate estimates in the subsampling
algorithm. The specified variables must be a subset from indepvars. If option m()
is provided, the dependent variable and the remaining independent variables
are residualized by regressing them on varlist using a Huber M
estimator. In each replication, the subsampling algorithm then obtains a
non-singular candidate fit from the residualized data. The candidate fit
will be augmented by the coefficients of the M estimate of the dependent
variable on varlist and then refined in the usual way based on the
original data. Specifying m() can lead to significant improvements in
computational speed and can also have beneficial effects on the stability
of the results, but the variables included in m() must be known to be
free of outliers (e.g. categorical variables). options are
efficiency() or k() to set the tuning constant of the Huber M
estimator (see m_options above); default is
efficiency(95). The procedure invoked by the m() option is similar
to the M-S estimator proposed by Maronna and Yohai (2000), but it results in
a true S estimator (in contrast to the M-S estimator, the M part is only used
to generate suitable candidate estimates without falling into the
collinearity trap; the candidates are then optimized in the same way as without
m() option).

fe_options are options to include fixed-effects in the model; see
Fixed effects options below.

nsamp(args) determines the number of trial samples for the search
algorithm. Specify nsamp(#) to use # trial samples. Alternatively,
specify nsamp(alpha [epsilon]) to determine the
number of trial samples as

ceil(ln(alpha) / ln(1 - (1 - epsilon)^k))

with a minimum of 20 and a maximum of 1000, where k is the
number of predictors included in the subsampling algorithm. alpha is
the maximum admissible risk of drawing a set of samples of which none is
free of outliers; epsilon is the assumed maximum fraction of
contaminated data. The default is to determine the number of subsamples
according to the above formula with alpha = 0.01 and
epsilon = 0.2.

rsteps(#) specifies the number of local improvement (refinement) steps
applied to the trial candidates. The default is rsteps(2).

nkeep(#) specifies the number of best candidates to be
kept for final refinement. The default is nkeep(5).

naive uses a naive subsampling algorithm. In each replication, the
algorithm keeps on drawing random p-subsets until a non-singular subset is found
(the algorithm aborts with error after 10'000 unsuccessful attempts). The
default is to use the fast nonsingular subsampling algorithm suggested
by Koller (2012) that creates a non-singular random p-subset by adding suitable
observations one-by-one, until the desired subset size is reached.

alt uses an alternative nonsingular subsampling algorithm that
expands the size of the random subset, instead of exchanging observations,
until it becomes nonsingular. The alternative algorithm is typically
somewhat faster than the default algorithm, but it may be less robust.

nostd omits standardization of the data for the subsampling
algorithm. To avoid precision problems, the default is to apply the subsampling
algorithm to data that has been standardized by deducting medians and
dividing by MADNs (or only by dividing by MADNs if noconstant
has been specified). Specifying nostd is not recommended.

Additional options for robreg mm

efficiency(#) sets the gaussian efficiency of the bisquare M
estimator, in percent. # must be between between 1 and 99.9. The
default is efficiency(85).

k(#) specifies a custom tuning constant for the bisquare M
estimator. The default is to use a tuning constant that is consistent with the
requested gaussian efficiency. k() and efficiency() are not
both allowed.

nohausman suppresses the Hausman test of the MM estimate against
the S estimate.

bp(#) sets the breakdown point of the preliminary S estimator,
in percent. # must be between 1 and 50. The default is bp(50).

sopts(options) are (other) options to be passed through to the preliminary
S estimator. options include all options listed above under
Additional options for robreg s (except nohausman)
as well as the options listed below under
Optimization (the default is to use the same
optimization settings as for the bisquare M estimator, i.e., the settings
specified outside sopts(); optimization option specified within
sopts() will override these settings).

Additional options for robreg lts

bp(#) sets the breakdown point, in percent, with #
between 1 and 50. The default is bp(50). bp()
determines the relative size of the H-subset with

h = (floor((1-#/100)*N) + floor(#/100*(K + 1))) / N

where N is the sample size and K is the number of (non-omitted)
coefficients in the model.

nsamp(args) determines the number of trial samples for the search
algorithm. Specify nsamp(#) to use # trial samples. Alternatively,
specify nsamp(alpha [epsilon]) to determine the
number of trial samples as explained above
(with a minimum of 50 and a maximum of 10'000).

csteps(#) specifies the number of concentration steps
applied to the trial candidates. The default is rsteps(2).

nkeep(#) specifies the number of best candidates to be
kept for final refinement. The default is nkeep(10).

naive, alt, and nostd are described above under
Additional options for robreg s.

Additional options for robreg lqs/lms

bp(#) sets the breakdown point, in percent, with #
between 1 and 50 (only allowed with robreg lqs). The default is
bp(50). bp() determines the relative size of the H-subset
(see above; for robreg lms, h is fixed at
0.5).

nsamp(args) determines the number of trial samples for the search
algorithm. Specify nsamp(#) to use # trial samples. Alternatively,
specify nsamp(alpha [epsilon]) to determine the
number of trial samples as explained above
(with a minimum of 500 and a maximum of 10'000).

naive, alt, and nostd are described above under
Additional options for robreg s.

VCE/SE

vce(vcetype) determines how standard errors are computed. vcetype may be:

robust
cluster clustvar
bootstrap [, bootstrap_options ]
jackknife [, jackknife_options ]

vce(robust), the default, computes heteroscedasticity-robust standard
errors based on influence functions (equivalent to the approach proposed by
Croux et al. 2003). Likewise, vce(cluster clustvar)
computes standard errors based on influence function allowing for intragroup
correlation, where clustvar specifies to which group each observation
belongs. vce(bootstrap) and vce(jackknife) compute standard errors
using bootstrap or jackknife, respectively; see help
vce_option. vce(robust) and vce(cluster) are not
supported by robreg lts, robreg lqs, and robreg lms.

cluster(clustvar) can be used as a synonym for vce(cluster clustvar).

ftest requests that the overall model test and the Hausman test (in case of
robreg s and robreg mm) be reported as F tests rather than
Wald chi-squared tests. The residual degrees of freedom for the F test will be determined
as the number of observations minus the number of (non-omitted) parameters
in the (main equation of the) model (or in case of clustered standard
errors, as the number of clusters minus one). The same residual degrees of freedom are
used for the t tests of the individual coefficients.

nose omits the computation of standard errors. Use this option to
save computer time.

Reporting

level(#) specifies the confidence level, as a percentage, for
confidence intervals. The default is level(95) or as set by
set level.

noheader suppresses the display of the table header.

notable suppresses the display of the table of results.

all reports results from all equations in case of robreg s and
robreg mm. The default is to display only the main equation.

display_options are standard reporting options such as eform,
cformat(), or coeflegend; see [R] eform_option and
the Reporting options in [R] Estimation options.

Optimization

tolerance(#) specifies the convergence tolerance for iterative
estimation procedures. When the maximum relative difference in coefficients
from one iteration to the next is less than or equal to the specified tolerance,
the convergence criterion is satisfied. The default is tolerance(1e-10).

An exception is robreg q, for which convergence is evaluated based on
the duality gap (convergence is reached if the duality gap is smaller than
the specified tolerance). The default for robreg q is tolerance(1e-8).

iterate(#) specifies the maximum number of iterations. Error will be returned
if convergence is not reached within the specified maximum number of iterations. The default is as set by
set maxiter.

relax causes robreg to proceed even if convergence is not reached.

noquad requests that double precision be used rather than quad precision
when taking cross products in weighted least-squares fits. Specifying
noquad will speed up computations for most estimators, but has the risk
of precision loss if the data is not well behaved (unreasonable means,
high collinearity). Note that noquad has no effect on computations
performed within the subsampling algorithm employed by robreg s and
robreg lts/lqs/lts (the subsampling algorithm does not use
quad precision because it operates on standardized data; also
see the nostd option above).

nolog suppresses the display of progress information.

Fixed effects options

ivar(varname) specifies a variable identifying groups for which
fixed effects are to be included in the model. Use
ivar() in cases in which the number of groups increases with the
sample size (e.g. panel data). ivar() mimics
the behavior of xtreg,fe with option robust, that is, it
implies clustering on the group variable when computing standard errors (unless
an alternative clustering variable is specified in vce() or
cluster(); in any case, groups must be nested within clusters).

absorb(varname) is an alternative to ivar() that mimics the
behavior of areg (no clustering implied; groups not required
to be nested within clusters; somewhat different computation of
degrees of freedom). Use absorb() in cases in which the number
of groups does not increase with the sample size.

[no]usave decides whether a fixed-effects lookup table is stored
in matrix e(u). For robreg ls the default is
nousave, as the fixed effects can be recovered after model
estimation. For all other models supporting ivar() or
absorb(), the default is usave. Typing nousave for these
models implies that predict_options options
involving fixed effects will not be available after model estimation.

ugenerate(newvar) stores the fixed effects as a variable in the data,
rather than storing a lookup table in e(u). ugenerate() takes precedence
over usave.

replace allows overwriting an existing variable.

Refitting options for robreg mm

efficiency(#) sets the gaussian efficiency of the bisquare M
estimator, in percent. # must be between between 1 and 99.9. The
default is efficiency(85).

k(#) specifies a custom tuning constant for the bisquare M
estimator. The default is to use a tuning constant that is consistent with the
requested gaussian efficiency. k() and efficiency() are not
both allowed.

nohausman suppresses the Hausman test of the MM estimate against
the S estimate.

ftest requests that the overall model test and the Hausman test
be reported as F tests rather than
Wald chi-squared tests.

reporting_options are reporting options as described above.

optimization_options are optimization options as described above.

Options for robreg hausman

constant includes the constant in the test. The default is to exclude the constant.

common restricts the test to coefficients that exist in both models. The
default is to use all (first-equation) coefficients from both models and
treat coefficients that only exist in one model as constrained to zero in
the other model.

keep(names) provides a space-separated list of coefficients to be included
in the test. Wildcard characters * and ? can be used in the names to
match multiple coefficients. The constant is handled by the constant option,
independently of keep().

keep(names) provides a space-separated list of coefficients to be excluded
from the test. Wildcard characters * and ? can be used in the names to
match multiple coefficients. The constant is handled by the constant option,
independently of drop().

ftest requests that the overall test be reported as an F test rather
than a Wald chi-squared test. The residual degrees of freedom for the F
test will be determined as the number of observations (in the joint sample
across both models) minus the number of (non-omitted) parameters in the
(main equation of the) larger model (or in case of clustered standard
errors, as the number of clusters in the joint sample minus one). The same
residual degrees of freedom are also used for the t tests of the differences
between coefficients

level(#) specifies the confidence level, as a percentage, for the
confidence intervals of the differences between coefficients. The default is
level(95) or as set by set level.

noheader suppresses the display of the header that contains the
overall test.

notable suppresses the display of the table that contains the t-tests
for the differences between individual coefficients.

display_options are standard reporting options such as eform,
cformat(), or coeflegend; see [R] eform_option and
the Reporting options in [R] Estimation options.

post stored the results in e(). The default is to store the results
in r().

Options for predict

xb calculates linear predictions.

xbu calculates linear predictions plus fixed effects. xbu is only
allowed after option ivar() or absorb() has been applied.

u calculates fixed effects. u is only
allowed after option ivar() or absorb() has been applied.

ue calculates fixed effects plus residuals. ue is only
allowed after option ivar() or absorb() has been applied.

residuals calculates residuals.

rstandard calculates standardized residuals (residuals divided by e(scale)).

outlier[(#)] generates a 0/1 variable identifying
outliers (1 = outlier, 0 = inlier). Optional argument # in [0,100] specifies the
percentage of observations to be classified as outliers in normal data. That is,
observations with absolute standardized residuals larger than
invnormal(1 - #/200) will be classified as outliers. The default is # = 2.5.

inlier[(#)] generates a 0/1 variable identifying
inliers (1 = inlier, 0 = outlier). Optional argument # in [0,100] specifies the
percentage of observations to be classified as inliers in normal data. That is,
observations with absolute standardized residuals smaller than or equal to
invnormal(.5 + #/200) will be classified as inliers. The default is # = 97.5.

weights generates a variable containing weights corresponding to the final
RLS fit. weights is only allowed after robreg m, robreg s,
and robreg mm.

subset generates a 0/1 variable identifying the H-subset. The variable
will be 1 for observations with squared residuals smaller than or equal to the
e(h) quantile of the squared residuals and 0 else. subset is only allowed after
robreg lts, robreg lqs, and robreg lms.

scores calculates equation-level scores. The scores can be used
together with the information stored in e(V_modelbased) to compute
the influence functions. scores is not allowed after
robreg lts, robreg lqs, or robreg lts. The scores
generated after robreg ls deviate from the scores obtained by
predict after regress by factor 1/e(scale)^2.

ifs calculates coefficient-level influence functions. The
influence functions are defined in a way such that their total is
zero and the standard error of the total (as computed by command total)
provides an estimate of the standard error of the coefficient. ifs is
not allowed after robreg lts, robreg lqs, or robreg lms.

rifs calculates recentered influence functions. The
recentered influence functions are defined in a way such that their mean is
equal to the relevant coefficient and the standard error of the mean
(as computed by command mean) provides an estimate of the standard
error of the coefficient. rifs is not allowed after
robreg lts, robreg lqs, or robreg lms.

Examples

Comparison of different estimators of the same model:

. sysuse auto, clear
. robreg ls price mpg weight headroom foreign
. robreg q price mpg weight headroom foreign
. robreg m price mpg weight headroom foreign
. robreg s price mpg weight headroom foreign
. robreg mm price mpg weight headroom foreign

We see, for example, that the effect of headroom has a p-value of 0.03
in the least-squares model, but is not significant in any of the robust
estimators. Furthermore, the Hausman test of S against LS indicates that
there are relevant outliers.

Refitting MM with different efficiencies (without re-estimating the S):

. sysuse auto, clear
. robreg s price mpg weight headroom foreign
. robreg mm, efficiency(75)
. robreg mm, efficiency(80)
. robreg mm, efficiency(85)
. robreg mm, efficiency(90)
. robreg mm, efficiency(95)

Performing Hausman tests between models: The following example illustrates
how one could do an interquantile range regression using robreg q followed
by robreg hausman.

. sysuse auto, clear
. robreg q price mpg weight headroom foreign, quantile(0.25)
. estimates store q25
. robreg q price mpg weight headroom foreign, quantile(0.75)
. estimates store q75
. robreg hausman q75 q25, constant

Using predict to flag outliers:

. sysuse auto, clear
. robreg mm price mpg weight headroom foreign
. predict outlier, outlier
. two scatter price weight if outlier==0 || scatter price weight if outlier==1

Using predict to generate recentered influence functions (the difference
in standard errors is because robreg divides by the residual degrees of freedom while
mean divides by N-1):

. sysuse auto, clear
. robreg q price mpg weight headroom foreign
. predict RIF*, rifs
. mean RIF*

Stored results

Depending on estimator and options, robreg saves a selection of the following
results in e().

Scalars

e(N) number of observations

e(N_clust) number of clusters (if vce(cluster))

e(k_eq) number of equations in e(b)

e(k_eform) number of equations to be affected by eform option

e(k_omit) number of omitted coefficients in e(b)

e(scale) estimate of residual scale

e(scale0) residual scale of empty model (unless nor2)

e(s0) raw scale (robreg lts/lqs/lms)

e(s0_0) raw scale of empty model (robreg lts/lqs/lms, unless nor2)

e(r2) R-squared (robreg ls)

e(r2_p) pseudo R-squared (all but robreg ls)

e(r2_w) R-squared from final WLS fit (robreg m/s/mm)

e(k) tuning constant (robreg m/s/mm)

e(m_k) tuning constant of residualizing M (robreg s/mm, if m())

e(kS) tuning constant of S estimate (robreg mm)

e(bp) breakdown point (robreg s/mm/lts/lqs)

e(efficiency) gaussian efficiency (robreg m/s/mm)

e(m_efficiency) gaussian efficiency of residualizing M (robreg s/mm, if m())

e(effS) gaussian efficiency of S estimate (robreg mm)

e(delta) consistency parameter for scale estimation (robreg s/mm)

e(h) relative size of H-subset (robreg lts/lqs/lms)

e(q_h) h-quantile of squared residuals (robreg lts/lqs/lms)

e(crit) value of optimization criterion (robreg lts/lqs/lms)

e(nsamp) number of subsamples (robreg s/mm/lts/lqs/lms)

e(rsteps) number of refinement steps (robreg s/mm)

e(csteps) number of concentration steps (robreg lts)

e(nkeep) number of candidates kept for final refinement (robreg s/mm/lts)

e(sum_adev) sum of absolute deviations (robreg q)

e(sum_rdev) sum of absolute deviations of empty model (robreg q, unless nor2)

e(q) quantile requested (robreg q)

e(bwidth) bandwidth (robreg q)

e(kbwidth) kernel bandwidth (robreg q, unless fitted)

e(iterations) number of iterations (robreg q/m/mm)

e(converged) 1 if converged, 0 else (robreg q/m/mm)

e(hausman_chi2) chi-squared statistic of Hausman test (robreg s/mm)

e(hausman_F) F statistic of Hausman test (robreg s/mm, if ftest)

e(hausman_p) p value of Hausman test (robreg s/mm)

e(N_g) number of groups (if relevant)

e(g_avg) average group size (if relevant)

e(g_min) minimum group size (if relevant)

e(g_max) maximum group size (if relevant)

e(corr) correlation between fixed effects and Xb (if relevant)

e(df_m) model degrees of freedom

e(df_r) residual degrees of freedom

e(chi2) chi-squared statistic of model test (unless nose)

e(F) F statistic of model test (if ftest, unless nose)

e(p) p value of model test (unless nose)

e(rank) rank of e(V) (unless nose)

e(level) confidence level (unless nose)

Macros

e(cmd) robreg

e(subcmd) ls, q, m, s, mm, lts, lqs, or lms

e(predict) robreg predict

e(cmdline) command as typed

e(depvar) name of dependent variable

e(indepvars) names of independent variables

e(m) variable names from m() option

e(noconstant) noconstant or empty

e(ivar) variable name from ivar() or empty

e(absorb) variable name from absorb() or empty

e(ugenerate) variable name from ugenerate() or empty

e(nor2) nor2 or empty

e(noquad) noquad or empty

e(denmethod) kernel or fitted (robreg q)

e(denmethod) gaussian (robreg q)

e(bofinger) bofinger or empty (robreg q)

e(vce) vcetype specified in vce()

e(vcetype) title used to label Std. Err.

e(clustvar) name of cluster variable

e(wtype) weight type

e(wexp) weight expression

e(title) title in estimation output

e(properties) b or b V

Matrices

e(b) estimates

e(V) variance-covariance matrix of estimates (unless nose)

e(omit) vector identifying omitted coefficients

e(V_modelbased) inverse of moment condition derivative matrix (unless nose)

e(u) fixed-effects lookup table (if appropriate)

e(b0) empty model fit (unless nor2)

e(b_init) starting values (robreg q/m)

e(b_lo) lower auxiliary fit (robreg q, if fitted)

e(b_up) upper auxiliary fit (robreg q, if fitted)

e(IFoffset) influence function offsets (robreg q)

Functions

e(sample) estimation sample

If vce() is bootstrap or jackknife, additional
results are stored in e(); see bootstrap and
jackknife, respectively.

robreg hausman saves the following results in r(). If option
post is specified, the results are moved to e().

Scalars

r(N) number of observations

r(N_clust) number of clusters (if vce(cluster))

r(df_m) test constraints degrees of freedom

r(df_r) residual degrees of freedom

r(chi2) chi-squared statistic of Hausman test

r(F) F statistic of Hausman test (if ftest)

r(p) p value of Hausman test

Macros

r(cmd) robreg

r(subcmd) hausman

r(wtype) weight type

r(wexp) weight expression

r(vce) vcetype specified in vce()

r(vcetype) title used to label Std. Err.

r(clustvar) name of cluster variable

r(title) title in estimation output

Matrices

r(b) coefficient differences

r(V) variance-covariance matrix

References

Croux, C., G. Dhaene, D. Hoorelbeke. 2003. Robust Standard Errors for
Robust Estimators. Discussions Paper Series (DPS) 03.16. Center for
Economic Studies.

Hendricks, W., R. Koenker. 1992. Hierarchical Spline Models for Conditional
Quantiles and the Demand for Electricity. Journal of the American Statistical
Association 87:58-68.

Huber, P.J. 1973. Robust Regression: Asymptotics, Conjectures and
Monte Carlo. The Annals of Statistics 1:799-821.

Koenker, R. 2005. Quantile Regression. Cambridge: Cambridge University Press.

Koller, M. 2012. Nonsingular subsampling for S-estimators with categorical
predictors. arXiv:1208.5595.

Maronna, R.A., V.J. Yohai. 2000. Robust regression with both
continuous and categorical predictors. Journal of Statistical
Planning and Inference 89:197-214.

Maronna, R.A., D.R. Martin, V.J. Yohai. 2006. Robust Statistics. Theory
and Methods. Chichester: Wiley.

Portnoy, S., R. Koenker. 1997. The Gaussian hare and the Laplacian
tortoise: computability of squared-error versus absolute-error
estimators. Statistical Science 12:279-300.

Powell, J.L. 1991. Estimation of monotonic regression models under quantile
restrictions. Pp. 357-384 in: W.A. Barnett, J. Powell, G.E. Tauchen (eds.). Nonparametric and
Semiparametric Methods in Econometrics and Statistics. Cambridge: Cambridge University Press.

Salibian-Barrera, M., V.J. Yohai. 2006. A Fast Algorithm for
S-Regression Estimates. Journal of Computational and Graphical
Statistics 15:414-427.

Rousseeuw, P.J. 1984. Least Median of Squares Regression. Journal of the
American Statistical Association 79:871-880.

Rousseeuw, P.J., M. Hubert. 1997. Recent developments in PROGRESS. Pp. 201-214
in: Y. Dodge (ed.). L1-Statistical Procedures and Related Topics. Hayward, CA: Institute of
Mathematical Statistics.

Rousseeuw, P.J., A.M. Leroy. 1987. Robust Regression and Outlier
Detection. New York: Wiley.

Rousseeuw, P.J., K. van Driessen. 2002. Computing LTS regression for
large data sets. Estadistica 54:163–190.

Rousseeuw, P., V. Yohai. 1984. Robust Regression by Means of
S-Estimators. Pp. 256-272 in: J. Franke, W. Hardle,
D. Martin (eds.). Robust and Nonlinear Time Series Analysis.
Lecture Notes in Statistics Vol. 26. Berlin: Springer.

Yohai, V.J. 1987. High Breakdown-Point and High Efficiency Robust
Estimates for Regression. The Annals of Statistics 15: 642-656.

Author

Ben Jann, University of Bern, ben.jann@unibe.ch

Thanks for citing this software as follows:

Jann, B. (2021). robreg: Stata module providing robust regression
estimators. Available from http://ideas.repec.org/c/boc/bocode/s458931.html.

Also see

Official Stata:
regress,
rreg,
qreg

SSC Archive:
xtrobreg,
robstat,
dstat,
robbox,
robmv,
moremata