Keeps only the links of W within a regime; with row_standardize
the rows are rescaled to sum to one (empty rows stay zero).
Usage
RegimeWeights(W, regimes, row_standardize = FALSE)
Arguments
- W
Spatial weights matrix.
- regimes
Regime label of each unit.
- row_standardize
Rescale rows after dropping links.
Examples
RegimeWeights(1 - diag(3), c(1, 1, 2))
#> [,1] [,2] [,3]
#> [1,] 0 1 0
#> [2,] 1 0 0
#> [3,] 0 0 0