help spivregalso see:spivreg postestimationspregspmat-------------------------------------------------------------------------------

Title

spivreg-- Spatial-autoregressive model with spatial-autoregressive erros and additional endogenous variables

Syntax

spivregdepvar[varlist1](varlist2=[varlist_iv])[if] [in],id(varname)[options]

optionsDescription ------------------------------------------------------------------------- Model *id(varname)ID variabledlmat(name)spmatobject used in the spatial-autoregressive termelmat(name)spmatobject used in the spatial-error termnoconstantsuppress constant termheteroskedasticuse the formula for the heteroskedastic error termimpower(q)useqpowers of matrixWin forming the instrument matrixH; default is2Maximization

maximize_optionscontrol the maximization process; seldom used ------------------------------------------------------------------------- * Required

Description

spivregestimates the parameters of a cross-sectional spatial-autoregressive model with spatial-autoregressive disturbances which is known as a SARAR model when there are additional endogenous regressors.A SARAR model includes a weighted average of the dependent variable, known as a spatial lag, as a right-hand-side variable and it allows the disturbance term to depend on a weighted average of the disturbances corresponding to other units. The weights may differ for each observation and are frequently inversely related to the distance from the current observation. These weights must be stored in a spatial-weighting matrix created by

spmat.

spivregestimates the parameters by generalized spatial two-stage least squares (GS2SLS).You can download Drukker, Prucha, and Raciborski (2011), which documents this command, from http://econweb.umd.edu/~prucha/Papers/WP_spivreg_2011.pdf.

Options+-------+ ----+ Model +------------------------------------------------------------

id(varname)specifies a numeric variable that contains a unique identifier for each observation. This option is required.

dlmat(name)specifies anspmatobject that contains the spatial-weighting matrixWto be used in the spatial-autoregressive term.

elmat(name)specifies anspmatobject that contains the spatial-weighting matrixMto be used in the spatial-error term.

noconstantsuppresses the constant term in the model.

heteroskedasticspecifies thatspivreguse an estimator that allowseto be heteroskedastically distributed over the observations. By default,spivreguses an estimator that assumes homoskedasticity.

impower(q)specifies how many powers of the matrixWto include in calculating the instrument matrixH. Integers in the set {2, 3, ...,floor(sqrt(cols(W)))} are allowed, withq=2being the default.+--------------+ ----+ Maximization +-----------------------------------------------------

maximize_options:iterate(#), []nolog,trace,gradient,showstep,showtolerance,tolerance(#),ltolerance(#),from(init_specs); see[R]maximize. These options are seldom used.

ExampleSetup

. use pollute. spmat use cobj using pollute.spmatEstimate the SARAR parameters

. spivreg pollution area (factories = penalties), id(id) dlmat(cobj)elmat(cobj)

Saved results

spivregsaves the following ine():Scalars

e(N)number of observationse(k)number of parameterse(rho_2sls)initial estimate ofrhoe(iterations)number of GMM iterationse(iterations_2sls)number of 2SLS iterationse(converged)1if GMM stage converged,0otherwisee(converged_2sls)1if 2SLS stage converged,0otherwiseMacros

e(cmdline)command as typede(cmd)spivrege(model)sarar,sar,sare, orlre(het)heteroskedasticorhomoskedastice(title)title in estimation outpute(depvar)name of dependent variablee(indeps)names of independent variablese(exogr)exogenous regressorse(insts)instrumentse(instd)instrumented variablese(constant)noconstantorhasconstante(H_omitted)names of omitted instruments inHe(idvar)name of ID variablee(dlmat)name ofspmatobject indlmat()e(elmat)name ofspmatobject inelmat()e(predict)program used to implementpredicte(estat_cmd)program used to implementestate(properties)b VMatrices

e(b)coefficient vectore(V)variance-covariance matrix of the estimatorse(delta_2sls)initial estimate oflambdaandbFunctions

e(sample)marks estimation sample

ReferencesDrukker, D. M., I. R. Prucha, and R. Raciborski. 2011. A command for estimating spatial-autoregressive models with spatial autoregressive disturbances and additional endogenous variables. Working paper, The University of Maryland, Department of Economics, http://econweb.umd.edu/~prucha/Papers/WP_spivreg_2011.pdf.

AuthorsDavid Drukker, StataCorp, College Station, TX. ddrukker@stata.com.

Ingmar Prucha, Department of Economics, University of Maryland, College Park, MD. prucha@econ.umd.edu.

Rafal Raciborski, StataCorp, College Station, TX. rraciborski@stata.com.

AcknowledgmentWe gratefully acknowledge financial support from the National Institute of Health through the SBIR grant R43 AG027622 and R44 AG027622.

Also seeOnline:

spmat,spreg,spmap,shp2dta,mif2dta(if installed)