0

Currently, I am trying to set up a dummy for regions that are contigious (1 if adjacent, 0 if not) in my regression. Sadly, I have just find answers for a spatial weight matrices, but that is not what I am looking for, because I am looking for a new variable (Contiguity) in my regression.

My data table would look like this (Gravity-Model):

Region_1; Region_2; Distance; Contiguity Dummy

I have information about the geometry of each region.

Thank you very much in advance for any kind of help!

Best regards, Christian

Progman
  • 16,827
  • 6
  • 33
  • 48
  • To add, I meant "Queen Contiguity" (all surrounding regions) – Christian Jul 30 '21 at 19:27
  • what kind of spatial information do you have about the region, e.g. a shapefile or geojson file or ... ? Any chance of a [mcve]? – Ben Bolker Jul 30 '21 at 19:57
  • Hey Ben, I have a shapefile of Germany (NUTS-3). I am a beginner with R, therfore I dont rly know how to create a "minimal reproducible example". Thats why I just added the code for a spatial weight matrice. Sadly, this doesnt show me that, for example, Region1 has Region 4-8 as neighbours. `Deutschland_shp <- read_sf("Shape_Deutschland/INKAR_NUTS3/krs.shp") plot(st_geometry(Deutschland_shp)) Deutschland_shp <- Deutschland_shp %>% select(AGS, NUTS, geometry) nb <- poly2nb(Deutschland_shp) W <- nb2listw(nb)` – Christian Jul 30 '21 at 21:09

0 Answers0