help rreg dialog: rreg
also see: rreg postestimation
-------------------------------------------------------------------------------
Title
[R] rreg -- Robust regression
Syntax
rreg depvar [indepvars] [if] [in] [, options]
options description
-------------------------------------------------------------------------
Model
tune(#) use # as the biweight tuning constant; default is
tune(7)
Reporting
level(#) set confidence level; default is level(95)
genwt(newvar) create newvar containing the weights assigned to
each observation
display_options control spacing and display of omitted variables
and base and empty cells
Optimization
optimization_options control the optimization process; seldom used
graph graph weights during convergence
+ coeflegend display coefficients' legend instead of
coefficient table
-------------------------------------------------------------------------
+ coeflegend does not appear in the dialog box.
indepvars may contain factor variables; see fvvarlist.
depvar and indepvars may contain time-series operators; see tsvarlist.
by, fracpoly, mfp, mi estimate, rolling, and statsby are allowed; see
prefix.
See [R] rreg postestimation for features available after estimation.
Menu
Statistics > Linear models and related > Other > Robust regression
Description
rreg performs one version of robust regression of depvar on indepvars.
Also see [R] regress for standard regression with robust variance
estimates and [R] qreg for quantile (including median or
least-absolute-residual) regression.
Options
+-------+
----+ Model +------------------------------------------------------------
tune(#) is the biweight tuning constant. The default is 7, meaning seven
times the median absolute deviation from the median residual. Lower
tuning constants downweight outliers rapidly but may lead to unstable
estimates (less than 6 is not recommended). Higher tuning constants
produce milder downweighting.
+-----------+
----+ Reporting +--------------------------------------------------------
level(#); see [R] estimation options.
genwt(newvar) creates the new variable newvar containing the weights
assigned to each observation.
display_options: noomitted, vsquish, noemptycells, baselevels,
allbaselevels; see [R] estimation options.
+--------------+
----+ Optimization +-----------------------------------------------------
optimization_options: iterate(#), tolerance(#), [no]log. iterate()
specifies the maximum number of iterations; iterations stop when the
maximum change in weights drops below tolerance(); and log/nolog
specifies whether to show the iteration log. These options are
seldom used.
graph allows you to graphically watch the convergence of the iterative
technique. The weights obtained from the most recent round of
estimation are graphed against weights obtained from the previous
round.
The following option is available with rreg but is not shown in the
dialog box:
coeflegend; see [R] estimation options.
Examples
Setup
. sysuse auto
Robust regression
. rreg mpg foreign#c.weight foreign
Same as above, but save estimated weights in genwt(w)
. rreg mpg foreign#c.weight foreign, genwt(w)
Saved results
rreg saves the following in e():
Scalars
e(N) number of observations
e(mss) model sum of squares
e(df_m) model degrees of freedom
e(rss) residual sum of squares
e(df_r) residual degrees of freedom
e(r2) R-squared
e(r2_a) adjusted R-squared
e(F) F statistic
e(rmse) root mean squared error
e(rank) rank of e(V)
Macros
e(cmd) rreg
e(cmdline) command as typed
e(depvar) name of dependent variable
e(genwt) variable containing the weights
e(title) title in estimation output
e(model) ols
e(vce) ols
e(properties) b V
e(predict) program used to implement predict
e(marginsok) predictions allowed by margins
e(asbalanced) factor variables fvset as asbalanced
e(asobserved) factor variables fvset as asobserved
Matrices
e(b) coefficient vector
e(V) variance-covariance matrix of the estimators
Functions
e(sample) marks estimation sample
Also see
Manual: [R] rreg
Help: [R] rreg postestimation;
[R] qreg, [R] regress