*! version 1.0 November2012

Help for spmlreg postestimation

Title

spmlreg postestimation -- Postestimation tools for spmlreg

Description

spmlreg allows the following postestimation commands:

command description

predict predicted values

Syntax for predict

predict [type] [if] [in] [, statistic]

statistic

Main
xb(redform|naive) predicted values based on reduced-form or observed values of y; default is xb(naive)

residuals residuals based on observed values of y

score request equation-level score variables

replace overwrite existing variables

Options for predict

Main

xb(reform|naive) requests that predicted values be calculated. Specifying xb(redform) generates predicted values
based on the reduced-form equation, y = (I-rho*W)^(-1)*X*b. When xb(naive) is specified,
predicted values are generated based on the observed values of y: rho*W*y + X*b.

residuals requests that residuals be calculated. Calculations are based on observed values of y:

e = y - rho*W*y + X*b + u

score calculates equation-level score variables. If score is specified without stub* only a variable
containing the first derivative of the log likelihood with respect to the linear prediction based on the observed values
of y will be calculated. Otherwise, depending on the spatial model estimated, new variables containing the derivative of the log likelihood with respect to rho,
lambda, and sigma will also be calculated.

replace overwrites existing newvar.

Examples

Load the Columbus crime dataset

. use http://fmwww.bc.edu/repec/bocode/c/columbus_dataset, clear

Import the first order contiguity spatial weights matrix, columbus.gal, created in GeoDa

. spwmatrix import using http://fmwww.bc.edu/repec/bocode/c/columbus.gal, wn(W) eignvar(eigvarW) row mataf

1) Obtain predictions and total impact after the spatial lag model

. spmlreg crime inc hoval, weights(W) wfrom(Mata) eignvar(eigvarW) model(lag)

a) Predictions based on reduced form

. predict yp, xb(redform)

b) Total impact

. nlcom (inc: _b[inc]*(1/(1-[rho]_cons))) (hoval: _b[hoval]*(1/(1-[rho]_cons)))

2) Obtain Linear predictions and information criteria after the spatial error model

. spmlreg crime inc hoval, weights(W) wfrom(Mata) eignvar(eigvarW) model(error)

. predict yp, replace

. estat ic

Author

P. Wilner Jeanty, Rice University

Email to pwjeanty@rice.edu

Citation

Users should please cite spmlreg as follows:

Jeanty, P.W., 2010. spmlreg: Stata module to estimate the spatial lag, the spatial error, the spatial durbin, and the general spatial models.