Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [spdep]

The tag has no usage guidance.

-1
votes
1answer
33 views

The slot for “plotOrder” comes up as 1 instead of a vector with length specific to my data

My goal is to find neighbors from my SpatialPolygons object using the poly2nb() command from the sp package in R. This is my code thus far: p <- s_gis %>% select(long, lat) %>% ...
0
votes
1answer
94 views

How do you find the appropriate spatial weight to use for a spatial analysis? [closed]

I am currently about to run a spatial regression (OLS, Lag, Error etc) for my dataset. My dataset contains 1000 randomly generated points throughout the utilisation distribution for my animals (so, ...
1
vote
0answers
300 views

LISA (local indicators of spatial association) p values in R versus in Geoda

When calculating LISA statistics in GeoDa versus using the localmoran() function in spdep, the I values are nearly the same, but the p values can be quite different. I know the two programs calculate ...
1
vote
1answer
2k views

Merge spatial and non-spatial data and create SpatialPolygonsDataFrame in r

I am trying to merge non-spatial data (data frame in R) and spatial data (SpatialPolygonsDataFrame in R) and eventually create the merged file in SpatialPolygonsDataFrame form. In specific, I ...
3
votes
1answer
248 views

Out-of-Sample predictions with spdep::sarlm

I am trying to make an out of-sample-prediction for spatial data using the spdep package. The documentation claims that this should be possible. However, I do not understand how it works. In ...
4
votes
0answers
490 views

Spatial weight matrix with boundary effects in R?

I need some help to finalize code for a spatial weight matrix that uses a nearest neighbor definition within regions, but does not allow neighbors from across a political border. For example, ...
1
vote
0answers
331 views

Using errorsalm() from spdep with multilevel data?

I have a dataset that has multiple observations per county, and I am interested in estimating the effect of a county-level variable on individual-level outcomes. I would like to account for adjacency ...
8
votes
3answers
1k views

Calculating spatial lags per year in R

At the moment I am having some difficulties with calculating a spatial lag in R. I know how to calculate the lag in space-wide format but am unable to do it in long form, i.e. have repeated ...