Given a dataframe of numeric values and a spatial weights matrix, calculate the spatial lag of each variable.
Arguments
- x
a
data.frameof independent variables generated withmake_x().- listw
a
listwobject generated withsim_grid_listw().- order
unused.
Examples
listw <- sim_grid_listw(10, 10)
x_vars <- make_x(100, mu = c(0.5, 1.2), var = c(1, 0.5))
res <- make_wx(x_vars, listw)
head(res)
#> x_1_lag x_2_lag
#> 1 1.2290535 1.768049
#> 2 1.0438814 1.362660
#> 3 0.9831329 1.451715
#> 4 1.4456114 1.341241
#> 5 1.7252607 1.709389
#> 6 2.2597195 1.615532