I used spmat to create a spatial weighting matrix. I exported it in neighbor list form. The first row is the number of spatial units, then there is a row for each spatial unit and its list of neighbors. I want to combine some spatial units by altering the neighbor list. Ex: a city in Virginia that resides inside a county. The shape file has these as separate units. In the example below, unit 3 is the city, unit 5 is the surrounding county. The shape file has a total of 133 spatial units.
133
1 5 14 73
2 11 78 80 81
3 5
4 12 133
5 3 79 124
To fold 3 into 5, I eliminate the row 3 and then alter the list of neighbors for 5 as below, but my question involves the first row: should I change the 133 to 132?
133 (or 132?)
1 5 14 73
2 11 78 80 81
4 12 133
5 79 124
How is the first row of the weighting matrix, in this compact form, used by Stata when constructing spatially weighted variables, etc.? I need to combine a few other cities and counties. Thank you Jo
Related Posts with Editing a spatial weighting matrix in neighbor list form
How to loop through multiple locals instead of all variables inside each local? Code: local ipv "angry fear intimacy_idx cont12_idx ev12_idx pv12_idx sv12_idx ipv_ovall_idx" local…
keep observations if first 2 character of the string is capital letterI have a dataset where the variable x is a string. I need to keep only observations at which the fir…
Transformation of valuesHi, I have a data set on tumors with the variables karnofsky index/KI (categorical with values 40, …
How to loop through two locals instead of all variables inside each local Code: local ipv "angry fear intimacy_idx cont12_idx ev12_idx pv12_idx sv12_idx ipv_ovall_idx" lo…
Problems corresponding to variable names in stata double-layer loopsI encountered a problem in the process of data merging. I put 5 control variables into 5 sheets of a…
Subscribe to:
Post Comments (Atom)
0 Response to Editing a spatial weighting matrix in neighbor list form
Post a Comment