help spmat lag


spmat lag -- Create a spatial lag variable


spmat lag [type] newvar objname varname


spmat lag creates a new variable that is a product of the spatial-weighting matrix contained in the spmat object objname and the variable varname. Algebraically, spmat lag computes W*y, where W is the spatial-weighting matrix and y is the variable.

The default storage type is float. Specify double for the type to store the result in double precision.


Setup . use pollute . spmat use cobj using pollute.spmat

Create the variable pollution_w containing a spatial lag of variable pollution . spmat lag double pollution_w cobj pollution

Also see

Online: spmat, spreg, spivreg, spmap, shp2dta, mif2dta (if installed)