**[R] areg** -- Linear regression with a large dummy-variable set

__Syntax__

**areg** *depvar* [*indepvars*] [*if*] [*in*] [*weight*]**,** __a__**bsorb(***varname***)** [*options*]

*options* Description
-------------------------------------------------------------------------
Model
* __a__**bsorb(***varname***)** categorical variable to be absorbed

SE/Robust
**vce(***vcetype***)** *vcetype* may be **ols**, __r__**obust**, __cl__**uster** *clustvar*,
__boot__**strap**, or __jack__**knife**

Reporting
__l__**evel(***#***)** set confidence level; default is **level(95)**
*display_options* control columns and column formats, row spacing,
line width, display of omitted variables and base
and empty cells, and factor-variable labeling

__coefl__**egend** display legend instead of statistics
-------------------------------------------------------------------------
* **absorb(***varname***)** is required.
*indepvars* may contain factor variables; see fvvarlist.
*depvar* and *indepvars* may contain time-series operators; see tsvarlist.
**bootstrap**, **by**, **fp**, **jackknife**, **mi estimate**, **rolling**, and **statsby** are
allowed; see prefix.
**vce(bootstrap)** and **vce(jackknife)** are not allowed with the **mi estimate**
prefix.
Weights are not allowed with the **bootstrap** prefix.
**aweight**s are not allowed with the **jackknife** prefix.
**aweight**s, **fweight**s, and **pweight**s are allowed; see weight.
**coeflegend** does not appear in the dialog box.
See **[R] areg postestimation** for features available after estimation.

__Menu__

**Statistics > Linear models and related > Other >** **Linear regression**
**absorbing one cat. variable**

__Description__

**areg** fits a linear regression absorbing one categorical factor. **areg** is
designed for datasets with many groups, but not a number of groups that
increases with the sample size. See the **xtreg, fe** command in **[XT] xtreg**
for an estimator that handles the case in which the number of groups
increases with the sample size.

__Options__

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

**absorb(***varname***)** specifies the categorical variable, which is to be
included in the regression as if it were specified by dummy
variables. **absorb()** is required.

+-----------+
----+ SE/Robust +--------------------------------------------------------

**vce(***vcetype***)** specifies the type of standard error reported, which
includes types that are derived from asymptotic theory (**ols**), that
are robust to some kinds of misspecification (**robust**), that allow for
intragroup correlation (**cluster** *clustvar*), and that use bootstrap or
jackknife methods (**bootstrap**, **jackknife**); see **[R] ***vce_option*.

**vce(ols)**, the default, uses the standard variance estimator for
ordinary least-squares regression.

Exercise caution when using the **vce(cluster** *clustvar***)** option with
**areg**. The effective number of degrees of freedom for the robust
variance estimator is n_g - 1, where n_g is the number of clusters.
Thus the number of levels of the **absorb()** variable should not exceed
the number of clusters.

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

**level(***#***)**; see **[R] estimation options**.

*display_options*: **noci**, __nopv__**alues**, __noomit__**ted**, **vsquish**, __noempty__**cells**,
__base__**levels**, __allbase__**levels**, __nofvlab__**el**, **fvwrap(***#***)**, **fvwrapon(***style***)**,
**cformat(***%fmt***)**, **pformat(%***fmt***)**, **sformat(%***fmt***)**, and **nolstretch**; see **[R]**
**estimation options**.

The following option is available with **areg** but is not shown in the
dialog box:

**coeflegend**; see **[R] estimation options**.

__Examples__

Setup
**. sysuse auto**

Regression with fixed effects for **rep78**
**. areg price weight length, absorb(rep78)**

Same as above, but also compute the bootstrap standard errors
**. areg price weight length, absorb(rep78) vce(bootstrap, reps(200))**

__Stored results__

**areg** stores the following in **e()**:

Scalars
**e(N)** number of observations
**e(k_absorb)** number of absorbed categories
**e(mss)** model sum of squares
**e(tss)** total 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(df_a)** degrees of freedom for absorbed effect
**e(rmse)** root mean squared error
**e(ll)** log likelihood
**e(ll_0)** log likelihood, constant-only model
**e(N_clust)** number of clusters
**e(F)** F statistic
**e(F_absorb)** F statistic for absorbed effect (when
**vce(robust)** is not specified)
**e(p)** p-value for model F test
**e(p_absorb)** p-value for F test of absorbed effect
**e(rank)** rank of **e(V)**

Macros
**e(cmd)** **areg**
**e(cmdline)** command as typed
**e(depvar)** name of dependent variable
**e(absvar)** name of **absorb** variable
**e(wtype)** weight type
**e(wexp)** weight expression
**e(title)** title in estimation output
**e(clustvar)** name of cluster variable
**e(vce)** *vcetype* specified in **vce()**
**e(vcetype)** title used to label Std. Err.
**e(datasignature)** the checksum
**e(datasignaturevars)** variables used in calculation of checksum
**e(properties)** **b V**
**e(predict)** program used to implement **predict**
**e(footnote)** program used to implement the footnote display
**e(marginsnotok)** predictions disallowed 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
**e(V_modelbased)** model-based variance

Functions
**e(sample)** marks estimation sample