Stata 15 help for rreg

[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 columns and column formats, row spacing, line width, display of omitted variables and base and empty cells, and factor-variable labeling

Optimization optimization_options control the optimization process; seldom used graph graph weights during convergence

coeflegend display legend instead of statistics ------------------------------------------------------------------------- indepvars may contain factor variables; see fvvarlist. depvar and indepvars may contain time-series operators; see tsvarlist. by, mfp, mi estimate, rolling, and statsby are allowed; see prefix. coeflegend does not appear in the dialog box. 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 Robust standard errors in [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; see Methods and formulas in [R] rreg. 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: noci, nopvalues, noomitted, vsquish, noemptycells, baselevels, allbaselevels, nofvlabel, fvwrap(#), fvwrapon(style), cformat(%fmt), pformat(%fmt), sformat(%fmt), and nolstretch; 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 the 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)

Stored results

rreg stores 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(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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index