help spmat export
-------------------------------------------------------------------------------

Title

spmat export -- Save the spatial-weighting matrix W contained in an spmat object to disk as a space-delimited text file

Syntax

spmat export objname using filename [, options]

options Description ------------------------------------------------------------------------- noid do not save place IDs nlist save the matrix as a neighbor list replace replace filename -------------------------------------------------------------------------

Description

spmat export saves the spatial-weighting matrix W contained in the spmat object objname to disk as a space-delimited text file. The first line of the file contains the number of columns of W and, if applicable, the lower and upper band. The spatial-weighting matrix is then written row-by-row, with the place identifiers recorded in the first column.

Options

noid specifies that place identifiers not be saved.

nlist specifies that the matrix be written in the neighbor-list format. The first line of the file will contain the total number of places and, if the matrix is banded, the lower and upper band. Each remaining line will list a place ID followed by its neighbors, if any.

replace allows filename to be overwritten if it already exists.

Example

Setup . spmat use cobj using pollute.spmat

Save the spmat object cobj to disk . spmat export cobj using cobj.txt

Also see

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