**[R] eivreg** -- Errors-in-variables regression

__Syntax__

**eivreg** *depvar* [*indepvars*] [*if*] [*in*] [*weight*] [**,** *options*]

*options* Description
-------------------------------------------------------------------------
Model
__r__**eliab(***indepvar* *#* [*indepvar # *[...]]**)**
specify measurement reliability for each *indepvar*
measured with error

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
-------------------------------------------------------------------------
*indepvars* may contain factor variables; see fvvarlist.
**bootstrap**, **by**, **jackknife**, **rolling**, and **statsby** are allowed; see prefix.
Weights are not allowed with the **bootstrap** prefix.
**aweight**s are not allowed with the **jackknife** prefix.
**aweight**s and **fweight**s are allowed; see weight.
**coeflegend** does not appear in the dialog box.
See **[R] eivreg postestimation** for features available after estimation.

__Menu__

**Statistics > Linear models and related > Errors-in-variables regression**

__Description__

**eivreg** fits errors-in-variables regression models when one or more of the
independent variables are measured with error. To use **eivreg**, you must
have an estimate of each independent variable's reliability or assume it
is measured without error.

__Options__

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

**reliab(***indepvar* *#* [*indepvar # *[...]]**)** specifies the measurement
reliability for each independent variable measured with error.
Reliabilities are specified as pairs consisting of an independent
variable name (a name that appears in *indepvars*) and the
corresponding reliability r, 0 < r __<__ 1. Independent variables for
which no reliability is specified are assumed to have reliability 1.
If the option is not specified, all variables are assumed to have
reliability 1, and the result is thus the same as that produced by
**regress** (the ordinary least-squares results).

+-----------+
----+ 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 **eivreg** but is not shown in the
dialog box:

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

__Example__

Setup
**. sysuse auto**

Fit regression in which **weight** and **mpg** are measured with reliabilities
0.85 and 0.9, respectively
**. eivreg price weight foreign mpg, r(weight .85 mpg .9)**

__Stored results__

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

Scalars
**e(N)** number of observations
**e(df_m)** model degrees of freedom
**e(df_r)** residual degrees of freedom
**e(r2)** R-squared
**e(F)** F statistic
**e(rmse)** root mean squared error
**e(rank)** rank of **e(V)**

Macros
**e(cmd)** **eivreg**
**e(cmdline)** command as typed
**e(depvar)** name of dependent variable
**e(rellist)** *indepvars* and associated reliabilities
**e(wtype)** weight type
**e(wexp)** weight expression
**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