[R-sig-Geo] Problem in creating neighbors, area and perimeter in spatial econometrics using R
solmaz.ahmadi at ut.ac.ir
Thu Sep 18 14:36:22 CEST 2014
I'm working on a `spatial cross section model` with
`R-programming-language `. I'm running these codes which refers to
`anselin data` (spatial_columbus) in `spdep` package. I found them from
MAIN PAGE :
library(spdep)# Loading required package: sp &Loading required package:
When I used these codes for data (columbus) in `spdep` package,
everything is fine, but when I want apply them to my data (human capital
index) I'm not able to define `neighborhood` for my data . My problem is
in this line `( neighbor<-col.gal.nb)`.it's the neighbors list from an
original `GAL-format file` and it's a pre-defined file . I don't know
any codes for creating neighbors to my data and I think my data
framework is different from spatial Columbus data framework (There is
`AREA`, `PERIMETER`,`ID` and `POLYID` columns that I don't have these
columns in my data framework).
The help link for `col.gal.nb` is here (you can open this link in R
environment after above codes)
MY QUESTIONS ARE:
1. How can I use `ArcGIS` to create `AREA` and `PERIMETER` to my data
file? I have some counties as samples. Are any easier solution for
finding these values or I should only use `ArcGIS` for this purpose?
2. Which code pack can I use to creating neighbors based on contiguity
and distance in `R`?
My dependent variable is `HCI `and `Y` is latitude, `X` is longitude and
other variables are independent variables.
My data set framework :
Pre-defined framwwork :
Thank you so much for your kind helps.
[[alternative HTML version deleted]]
More information about the R-sig-Geo