Title: | Outright Tool for the Analysis of Spatial Inequalities and Segregation |
---|---|
Description: | A comprehensive set of indexes and tests for social segregation analysis, as described in Tivadar (2019) - 'OasisR': An R Package to Bring Some Order to the World of Segregation Measurement <doi:10.18637/jss.v089.i07>. The package is the most complete existing tool and it clarifies many ambiguities and errors regarding the definition of segregation indices. Additionally, 'OasisR' introduces several resampling methods that enable testing their statistical significance (randomization tests, bootstrapping, and jackknife methods). |
Authors: | Mihai Tivadar [aut, cre] |
Maintainer: | Mihai Tivadar <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 3.1.1 |
Built: | 2025-01-06 06:49:46 UTC |
Source: | CRAN |
The absolute centralization index measures a group spatial distribution compared to the distribution of land area around the city center. The function can be used in two ways: to provide an area vector and a vector containing the distances between spatial units centroids and the central spatial unit or a external geographic information source (spatial object or shape file).
ACE(x, a = NULL, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
ACE(x, a = NULL, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
a |
a numeric vector containing spatial unit areas |
dc |
a numeric vector containing the distances between spatial units centroids and the central spatial unit |
center |
a numeric value giving the number of the spatial unit that represents the center in the table |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing the Massey and Denton absolute centralisation index values for each group
Massey D. S. and Denton N. A. (1988) The dimensions of residential segregation. Social Forces 67(2), pp. 281-315.
x <- segdata@data[ ,1:2] ar<-area(segdata) distc<- distcenter(segdata, center = 28) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACE(x, a = ar, dc=distc) ACE(x, spatobj = segdata, center = 28) ACE(x, folder = foldername, shape = shapename, center = 28)
x <- segdata@data[ ,1:2] ar<-area(segdata) distc<- distcenter(segdata, center = 28) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACE(x, a = ar, dc=distc) ACE(x, spatobj = segdata, center = 28) ACE(x, folder = foldername, shape = shapename, center = 28)
Duncan's absolute centralization index measures the proportion of a group that should change its localization to achieve the same level of centralization as the rest of the population. The function can be used in two ways: to provide a vector containing the distances between spatial/organizational unit centroids or a external geographic information source (spatial object or shape file).
ACEDuncan(x, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
ACEDuncan(x, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
dc |
a numeric vector containing the distances between spatial units centroids and the central spatial unit |
center |
a numeric value giving the number of the spatial unit that represents the center in the table |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing the Duncan's absolute centralisation index values for each group
Duncan O. D. and Duncan B. (1955) A Methodological Analysis of Segregation Indexes. American Sociological Review 41, pp. 210-217
ACEDuncanPoly
, ACEDuncanPolyK
,
x <- segdata@data[ ,1:2] distc<- distcenter(segdata, center = 28) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACEDuncan(x, dc=distc) ACEDuncan(x, spatobj = segdata, center = 28) ACEDuncan(x, folder = foldername, shape = shapename, center = 28)
x <- segdata@data[ ,1:2] distc<- distcenter(segdata, center = 28) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACEDuncan(x, dc=distc) ACEDuncan(x, spatobj = segdata, center = 28) ACEDuncan(x, folder = foldername, shape = shapename, center = 28)
Polycentric version of Duncan's absolute centralization index. The function can be used in two ways: to provide a vector containing the distances between spatial/organizational unit centroids or a external geographic information source (spatial object or shape file).
ACEDuncanPoly(x, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
ACEDuncanPoly(x, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
dc |
a numeric matrix/vector containing the distances between spatial units centroids and the central spatial unit(s). |
center |
a numeric vector giving the number of the spatial/organizational units that represents the centers in the table |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing the Duncan's absolute polycentric centralisation index value for each group
Duncan O. D. and Duncan B. (1955) A Methodological Analysis of Segregation Indexes. American Sociological Review 41, pp. 210-217
Tivadar M. (2019) OasisR: An R Package to Bring Some Order to the World of Segregation Measurement. Journal of Statistical Software, 89 (7), pp 1-39
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACEDuncanPoly(x, spatobj = segdata, center = c(28, 83) ) ACEDuncanPoly(x, folder = foldername, shape = shapename, center = c(28, 83)) center <- c(28, 83) polydist <- matrix(data = NA, nrow = nrow(x), ncol = length(center)) for (i in 1:ncol(polydist)) polydist[,i] <- distcenter(spatobj = segdata, center = center[i]) ACEDuncanPoly(x, dc = polydist) distmin <- vector(length = nrow(x)) for (i in 1:nrow(polydist)) distmin[i] <- min(polydist[i,]) ACEDuncan(x, dc = distmin)
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACEDuncanPoly(x, spatobj = segdata, center = c(28, 83) ) ACEDuncanPoly(x, folder = foldername, shape = shapename, center = c(28, 83)) center <- c(28, 83) polydist <- matrix(data = NA, nrow = nrow(x), ncol = length(center)) for (i in 1:ncol(polydist)) polydist[,i] <- distcenter(spatobj = segdata, center = center[i]) ACEDuncanPoly(x, dc = polydist) distmin <- vector(length = nrow(x)) for (i in 1:nrow(polydist)) distmin[i] <- min(polydist[i,]) ACEDuncan(x, dc = distmin)
Constrained (local) version of Duncan's centralization index. The function can be used in two ways: to provide a matrix containing the distances between spatial/organizational unit centroids or a external geographic information source (spatial object or shape file).
ACEDuncanPolyK(x, dc = NULL, K = NULL, kdist = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
ACEDuncanPolyK(x, dc = NULL, K = NULL, kdist = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
dc |
a numeric matrix/vector containing the distances between spatial units centroids and the central spatial unit(s). |
K |
the number of neighbourhoods under the influence of a center |
kdist |
the maximal distance that defines the neighbourhoods influenced by a center |
center |
a numeric vector giving the number of the spatial units that represent the centers in the table |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing the Duncan's constrainted absolute centralisation index value for each group
Duncan O. D. and Duncan B. (1955) A Methodological Analysis of Segregation Indexes. American Sociological Review 41, pp. 210-217
Folch D.C and Rey S. J (2016) The centralization index: A measure of local spatial segregation. Papers in Regional Science 95 (3), pp. 555-576
Tivadar M. (2019) OasisR: An R Package to Bring Some Order to the World of Segregation Measurement. Journal of Statistical Software, 89 (7), pp 1-39
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACEDuncanPolyK(x, spatobj = segdata, center = c(28, 83)) ACEDuncanPolyK(x, folder = foldername, shape = shapename, center = c(28, 83), K = 3) center <- c(28, 83) polydist <- matrix(data = NA, nrow = nrow(x), ncol = length(center)) for (i in 1:ncol(polydist)) polydist[,i] <- distcenter(spatobj = segdata, center = center[i]) ACEDuncanPolyK(x, dc = polydist, kdist = 2)
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACEDuncanPolyK(x, spatobj = segdata, center = c(28, 83)) ACEDuncanPolyK(x, folder = foldername, shape = shapename, center = c(28, 83), K = 3) center <- c(28, 83) polydist <- matrix(data = NA, nrow = nrow(x), ncol = length(center)) for (i in 1:ncol(polydist)) polydist[,i] <- distcenter(spatobj = segdata, center = center[i]) ACEDuncanPolyK(x, dc = polydist, kdist = 2)
The absolute centralization index measures a group spatial distribution compared to the distribution of land area around the city center. The function can be used in two ways: to provide an area vector and a vector containing the distances between spatial units centroids and the central spatial unit or a external geographic information source (spatial object or shape file).
ACEPoly(x, a = NULL, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
ACEPoly(x, a = NULL, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
a |
a numeric vector containing spatial unit areas |
dc |
a numeric matrix containing the distances between spatial units centroids and the central spatial units |
center |
a numeric vector giving the number of the spatial units that represent the centers in the table |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing the Massey and Denton absolute polycentric centralisation index values for each group
Massey D. S. and Denton N. A. (1988) The dimensions of residential segregation. Social Forces 67(2), pp. 281-315.
Tivadar M. (2019) OasisR: An R Package to Bring Some Order to the World of Segregation Measurement. Journal of Statistical Software, 89 (7), pp 1-39
x <- segdata@data[ ,1:2] ar<-area(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACEPoly(x, spatobj = segdata, center = c(28, 83) ) ACEPoly(x, folder = foldername, shape = shapename, center = c(28, 83)) center <- c(28, 83) polydist <- matrix(data = NA, nrow = nrow(x), ncol = length(center)) for (i in 1:ncol(polydist)) polydist[,i] <- distcenter(spatobj = segdata, center = center[i]) ACEPoly(x, a = ar, dc = polydist) distmin <- vector(length = nrow(x)) for (i in 1:nrow(polydist)) distmin[i] <- min(polydist[i,]) ACE(x, a = ar, dc = distmin)
x <- segdata@data[ ,1:2] ar<-area(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACEPoly(x, spatobj = segdata, center = c(28, 83) ) ACEPoly(x, folder = foldername, shape = shapename, center = c(28, 83)) center <- c(28, 83) polydist <- matrix(data = NA, nrow = nrow(x), ncol = length(center)) for (i in 1:ncol(polydist)) polydist[,i] <- distcenter(spatobj = segdata, center = center[i]) ACEPoly(x, a = ar, dc = polydist) distmin <- vector(length = nrow(x)) for (i in 1:nrow(polydist)) distmin[i] <- min(polydist[i,]) ACE(x, a = ar, dc = distmin)
The absolute clustering index, ACL, expresses the average number of a group's members in nearby spatial units, as a proportion of the total population in those spatial units. The spatial interactions can be expressed as a contiguity matrix (with diagonal equal to 1), as an inverse exponential function of the distance between spatial units centers (with diagonal equal to 0.6 of the square root of each spatial units area) or other user specified interaction matrix. The function can be used in two ways: to provide a spatial interactions matrix (a contiguity matrix or a distance matrix) or a external geographic information source (spatial object or shape file).
ACL(x, spatmat = 'c', c = NULL, queen = FALSE, d = NULL, distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
ACL(x, spatmat = 'c', c = NULL, queen = FALSE, d = NULL, distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
spatmat |
the method used for spatial calculations: 'c' for the contiguity matrix (by default) or any other user spatial interaction matrix and 'd' for the inverse exponential function of the distance. |
c |
a modified binary contiguity (adjacency) symmetric matrix where each element Cij equals 1 if i-th and j-th spatial units are adjacent or identical, and 0 otherwise. |
queen |
logical parameter difining criteria used for contiguity matrix computation, TRUE for queen, FALSE (by default) for rook |
d |
a matrix of the distances between spatial unit centroids |
distin |
input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
when providing a spatial object or a shape file, the user has the choice of the spatial matrix diagonal definition: diagval = '0' (by default) for an null diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial/organizational unitsarea) (White, 1983) |
beta |
distance decay parameter |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing the Absolute Clustering index values for each group
Massey D. S. and Denton N. A. (1988) The dimensions of residential segregation. Social Forces 67(2), pp. 281-315.
Proximity measures: Pxx
,
Pxy
, Poo
, SP
Relative Clustering Index: RCL
x <- segdata@data[ ,1:2] contiguity <- contig(segdata) diag(contiguity) <- 1 ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACL(x, c = contiguity) ACL(x, spatobj = segdata) ACL(x, spatmat = 'd', folder = foldername, shape = shapename) ACL(x, spatmat = 'd', diagval = 'a', spatobj = segdata) ACL(x, d = dist, spatmat = 'd')
x <- segdata@data[ ,1:2] contiguity <- contig(segdata) diag(contiguity) <- 1 ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ACL(x, c = contiguity) ACL(x, spatobj = segdata) ACL(x, spatmat = 'd', folder = foldername, shape = shapename) ACL(x, spatmat = 'd', diagval = 'a', spatobj = segdata) ACL(x, d = dist, spatmat = 'd')
The absolute concentration index, ACO, computes the total area inhabited by a group, and compares the result to the minimum and maximum possible areas that could be inhabited by that group in the study area. The function can be used in two ways: to provide an area vector or a external geographic information source (spatial object or shape file).
ACO(x, a = NULL, spatobj = NULL, folder = NULL, shape = NULL)
ACO(x, a = NULL, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
a |
a numeric vector containing spatial unit areas |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing the Absolute Concentration index values for each group
Massey D. S. and Denton N. A. (1988) The dimensions of residential segregation. Social Forces 67(2), pp. 281-315.
Delta Index: Delta
Relative Concentration Index: RCO
x <- GreHSize@data[ ,3:5] ar <- area(GreHSize) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'GreHSize' ACO(x, a = ar) ACO(x, spatobj = GreHSize) ACO(x, folder = foldername, shape = shapename)
x <- GreHSize@data[ ,3:5] ar <- area(GreHSize) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'GreHSize' ACO(x, a = ar) ACO(x, spatobj = GreHSize) ACO(x, folder = foldername, shape = shapename)
The function is based on sf package and can be used with a shape file or an R spatial object (class sf, sfc or sfg).
area(spatobj = NULL, folder = NULL, shape = NULL)
area(spatobj = NULL, folder = NULL, shape = NULL)
spatobj |
a spatial object (class sf, sfc or sfg) containing geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile with the geographic information is located. |
shape |
a character vector with the name of the shapefile (without the .shp extension) which contains the geographic information |
A vector containing the areas of spatial units
Other spatial functions used for segregation indices
computation: contig
, perimeter
,
distance
, distcenter
,
boundaries
area(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' area(folder = foldername, shape = shapename)
area(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' area(folder = foldername, shape = shapename)
The spatial version of Atkinson inequality index is based on Lorenz curves. The user can decide wich part of the curve contributes more to the index, by choosing the value of the shape parameter, delta.
Atkinson (x, delta = 0.5)
Atkinson (x, delta = 0.5)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
delta |
an inequality aversion parameter |
A numeric vector containing Atkinson's segregation index values for each group
James, D. and K. E. Taeuber (1985) Measures of Segregation. Sociological Methodology 15, pp. 1-32
One-group evenness indices:
ISDuncan
, Gini
, Gorard
,
HTheil
, 'ISWong
, ISMorrill
,
ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, Gini2
,
DIMorrill
, DIMorrillK
, DIWong
x <- segdata@data[ ,7:8] Atkinson(x) Atkinson(x, 0.1) Atkinson(x, delta = 0.9)
x <- segdata@data[ ,7:8] Atkinson(x) Atkinson(x, 0.1) Atkinson(x, delta = 0.9)
The function is based on sf package and it can be used with a shape file or an R spatial object (class sf, sfc or sfg).
boundaries(spatobj = NULL, folder = NULL, shape = NULL)
boundaries(spatobj = NULL, folder = NULL, shape = NULL)
spatobj |
a spatial object (class sf, sfc or sfg) containing geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile with the geographic information is located. |
shape |
a character vector with the name of the shapefile (without the .shp extension) which contains the geographic information |
A common boundaries matrix
Other spatial functions used for segregation indices
computation: area
, contig
,
perimeter
, distance
,
distcenter
boundaries(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' boundaries(folder = foldername, shape = shapename)
boundaries(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' boundaries(folder = foldername, shape = shapename)
The index can be interpreted as a measure of the variance of the spatial representation of the groups accros spatial unite, or as a normalized chi-squared measure of association between groups and units.
CMulti(x)
CMulti(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
The multigroup entropy segregation index value (numeric)
Reardon S. F. and Firebaugh G. (2002) Measures of multigroup segregation. Sociological Methodology, 32, pp. 33-67.
multigroup indices:
PMulti
, GiniMulti
, DMulti
,
HMulti
, RelDivers
Social diversity indices:
HShannon
, NShannon
,
ISimpson
,
x <- segdata@data[ ,1:2] CMulti(x)
x <- segdata@data[ ,1:2] CMulti(x)
The function is based on sf package and can be used with a shape file or an R spatial object (class sf, sfc or sfg).
contig(spatobj = NULL, folder = NULL, shape = NULL, queen = FALSE)
contig(spatobj = NULL, folder = NULL, shape = NULL, queen = FALSE)
spatobj |
a spatial object (class sf, sfc or sfg) containing geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile with the geographic information is located. |
shape |
a character vector with the name of the shapefile (without the .shp extension) which contains the geographic information |
queen |
= TRUE for queen criteria, FALSE (by default) for rook criteria |
A first order contiguity (adjacency) matrix, where each element [i,j] equals 1 if i-th and j-th spatial units are adjacent, 0 otherwise (queen or rook criteria)
Other spatial functions used for segregation indices
computation: area
, perimeter
,
distance
, distcenter
,
boundaries
contig(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' contig(folder = foldername, shape = shapename)
contig(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' contig(folder = foldername, shape = shapename)
The Delta index is a specific application of dissimilarity
index DIDuncan
which simply measures the dissimilarity
between the spatial distribution of a group and the spatial
distribution of available land. It can be interpreted as the share of group
that would have to move to achieve uniform density over all spatial units.
The function can be used in two ways: to provide an area vector or
a external geographic information source (spatial object or shape file).
Delta(x, a = NULL, spatobj = NULL, folder = NULL, shape = NULL)
Delta(x, a = NULL, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
a |
a numeric vector containing spatial unit areas |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing the Delta index values for each group
Duncan O. D., Cuzzoert and Duncan B. (1961) Problems in analyzing areal data. Statistical geography, Glencoe, Illinois: The free press of Glencoe
Absolute Concentration Index: ACO
Relative Concentration Index: RCO
x <- segdata@data[ ,1:2] ar <- area(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' Delta(x, a = ar) Delta(x, spatobj = segdata) Delta(x, folder = foldername, shape = shapename)
x <- segdata@data[ ,1:2] ar <- area(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' Delta(x, a = ar) Delta(x, spatobj = segdata) Delta(x, folder = foldername, shape = shapename)
Duncan's dissimilarity index is the segregation index most commonly used in the literature. It is derived from Lorenz curves as the maximum difference between the segregation curve and the diagonal. The index measures the unevenness of a group's spatial distribution compared to another group. It can be interpreted as the share of the group that would have to move to achieve an even distribution compared to another group.
DIDuncan(x)
DIDuncan(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
A matrix containing the dissimilarity index values for each pair of groups
Duncan O. D. and Duncan B. (1955) A Methodological Analysis of Segregation Indexes. American Sociological Review 41, pp. 210-217
Other one-group evenness indices:
ISDuncan
, Gini
, Gorard
,
Atkinson
, HTheil
,
ISWong
, ISMorrill
, ISMorrillK
Between groups dissimilarity indices:
DIMorrill
, DIMorrillK
, DIWong
x <- segdata@data[ ,1:2] DIDuncan(x)
x <- segdata@data[ ,1:2] DIDuncan(x)
Morrill's dissimilarity index is a development of
DIDuncan
's index which takes into account the
interactions between spatial units(contiguity). The function can
be used in two ways: to provide a contiguity matrix or a external
geographic information source (spatial object or shape file).
DIMorrill(x, c = NULL, queen = FALSE, spatobj = NULL, folder = NULL, shape = NULL)
DIMorrill(x, c = NULL, queen = FALSE, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
c |
a standard binary contiguity (adjacency) symmetric matrix where each element Cij equals 1 if i-th and j-th spatial units are adjacent, and 0 otherwise. |
queen |
a logical parameter difining criteria used for contiguity matrix computation, TRUE for queen, FALSE (by default) for rook |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension) . |
A matrix containing the Morrill's dissimilarity index values for each pair of groups
Morrill B. (1991) On the measure of geographic segregation. Geography research forum, 11, pp. 25-36.
Other one-group evenness indices:
ISDuncan
, Gini
, Gorard
,
Atkinson
, HTheil
,
ISWong
, ISMorrill
, ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, DIMorrillK
, DIWong
x <- segdata@data[ ,1:2] contiguity <- contig(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' DIMorrill(x, c = contiguity) DIMorrill(x, spatobj = segdata, queen = FALSE) DIMorrill(x, folder = foldername, shape = shapename)
x <- segdata@data[ ,1:2] contiguity <- contig(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' DIMorrill(x, c = contiguity) DIMorrill(x, spatobj = segdata, queen = FALSE) DIMorrill(x, folder = foldername, shape = shapename)
This function compute an adaptation of Morrill's dissimilarity index which takes into account the interactions between spatial units defined by K order contiguity matrix. The function can be used in two ways: to provide a contiguity matrix or a external geographic information source (spatial object or shape file).
DIMorrillK(x, ck = NULL, queen = FALSE, spatobj = NULL, folder = NULL, shape = NULL, K = 2, f = 'exp', beta = 1, prec = NULL)
DIMorrillK(x, ck = NULL, queen = FALSE, spatobj = NULL, folder = NULL, shape = NULL, K = 2, f = 'exp', beta = 1, prec = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
ck |
a list with contiguity matrix for each order (from 1 to K) |
queen |
logical parameter difining criteria used for contiguity matrix computation, TRUE for queen, FALSE (by default) for rook |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension) . |
K |
contiguity matrix order |
f |
the distance function, f = 'exp' (by default) for negative exponential function and f = 'rec' for reciprocal function |
beta |
distance decay parameter |
prec |
precision parameter. If not NULL, the function stop computing the spatial interaction when the impact on the indice is bellow 10 ^ (-prec) |
A matrix containing the Generalized Morrill's dissimilarity index values for each pair of groups
Morrill B. (1991) On the measure of geographic segregation. Geography research forum, 11, pp. 25-36.
Other one-group evenness indices:
ISDuncan
, Gini
, Gorard
,
Atkinson
, HTheil
,
ISWong
, ISMorrill
, ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, DIMorrill
, DIWong
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' DIMorrillK(x, spatobj = segdata, queen = FALSE, K = 3) DIMorrillK(x, folder = foldername, shape = shapename, K = 4, f = 'rec')
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' DIMorrillK(x, spatobj = segdata, queen = FALSE, K = 3) DIMorrillK(x, folder = foldername, shape = shapename, K = 4, f = 'rec')
The function is based on sf package and can be used with a shape file or an R spatial object (class sf, sfc or sfg).
distance(spatobj = NULL, folder = NULL, shape = NULL, distin = 'm', distout = 'm', diagval = '0')
distance(spatobj = NULL, folder = NULL, shape = NULL, distin = 'm', distout = 'm', diagval = '0')
spatobj |
a spatial object (class sf, sfc or sfg) containing geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile with the geographic information is located. |
shape |
a character vector with the name of the shapefile (without the .shp extension) which contains the geographic information |
distin |
input metric conversion, based on measurements package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on measurements package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
the user has the choice of the definition of the diagonal: diagval = '0' (by default) for an 'empty' diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial units area) (White, 1983) |
A matrix with the distance between spatial units centroids
Other spatial functions used for segregation indices
computation: area
, contig
,
perimeter
, distcenter
,
boundaries
distance(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' distance(folder = foldername, shape = shapename)
distance(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' distance(folder = foldername, shape = shapename)
The function is based on sf package and it can be used with a shape file or an R spatial object (class sf, sfc or sfg).
distcenter(spatobj = NULL, folder = NULL, shape = NULL, center = 1, distin = 'm', distout = 'm')
distcenter(spatobj = NULL, folder = NULL, shape = NULL, center = 1, distin = 'm', distout = 'm')
spatobj |
a spatial object (class sf, sfc or sfg) containing geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile with the geographic information is located. |
shape |
a character vector with the name of the shapefile (without the .shp extension) which contains the geographic information |
center |
the row number of the center |
distin |
input metric conversion, based on measurements package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on measurements package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
A vector with the distance to the center's centroid
Other spatial functions used for segregation indices
computation: area
, contig
,
perimeter
, distance
,
boundaries
distcenter(segdata, center = 46) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' distcenter(folder = foldername, shape = shapename, center = 19)
distcenter(segdata, center = 46) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' distcenter(folder = foldername, shape = shapename, center = 19)
Wong's dissimilarity index is a development of
DIDuncan
's which takes into account the interactions
between spatial units(common boundaries and perimeter/area ratios).
The function can be used in two ways: to provide spatial data (
boundaries matrix, a perimeter vector and an area vector)
or a external geographic information source (spatial object or shape file).
DIWong(x, b = NULL, a = NULL, p = NULL, ptype = 'int', variant = 's', spatobj = NULL, folder = NULL, shape = NULL)
DIWong(x, b = NULL, a = NULL, p = NULL, ptype = 'int', variant = 's', spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total totals because this will be interpreted as a group |
b |
a common boundaries matrix where each element Bij equals the shared boundary of i-th and j-th spatial units. |
a |
a numeric vector containing spatial unit areas |
p |
a numeric vector containing spatial units perimeters. |
ptype |
a string variable giving two options for perimeter calculation when a spatial object or shapefile is provided: 'int' to use only interior borders of spatial units, and 'all' to use entire borders, including to the exterior of the area |
variant |
a character variable that allows to choose the index version: variant = 's' for the dissimilarity index adjusted for contiguous spatial units boundary lengths and perimeter/area ratio (by default) and variant = 'w' for the version without perimeter/area ratio |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A matrix containing the Wong's dissimilarity index values for each pair of groups
Wong D. W. S. (1993) Spatial Indices of Segregation. Urban Studies, 30 (3), pp. 559-572.
Other one-group evenness indices:
ISDuncan
, Gini
, Gorard
,
Atkinson
, HTheil
,
'ISWong
, ISMorrill
, ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, DIMorrill
, DIMorrillK
x <- segdata@data[ ,1:2] bound <- boundaries(segdata) per <- perimeter(segdata) ar <- area(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' DIWong(x, b = bound, p = per, a = ar) DIWong(x, spatobj = segdata, variant = 'w') DIWong(x, folder = foldername, shape = shapename, ptype ='all')
x <- segdata@data[ ,1:2] bound <- boundaries(segdata) per <- perimeter(segdata) ar <- area(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' DIWong(x, b = bound, p = per, a = ar) DIWong(x, spatobj = segdata, variant = 'w') DIWong(x, folder = foldername, shape = shapename, ptype ='all')
multigroup dissimilarity index, is a multigroup
version of Duncan's dissimilarity index (DIDuncan
)
DMulti(x)
DMulti(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
The multigroup dissimilarity index value (numeric)
Sakoda J. N. (1981) A generalized Index of dissimilarity. Demography,18, 245-250
multigroup indices:
PMulti
, GiniMulti
,
HMulti
, CMulti
, RelDivers
Social diversity indices:
HShannon
, NShannon
,
ISimpson
,
x <- segdata@data[ ,1:2] DMulti(x)
x <- segdata@data[ ,1:2] DMulti(x)
The distance decay isolation index, DPxx, is a spatial
adaptation of isolation index xPx
. The function can be
used in two ways: to provide a distance matrix or a external geographic
information source (spatial object or shape file).
DPxx(x, d = NULL, distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
DPxx(x, d = NULL, distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
d |
a matrix of the distances between spatial unit centroids |
distin |
input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
when providing a spatial object or a shape file, the user has the choice of the spatial matrix diagonal definition: diagval = '0' (by default) for an null diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial/organizational unitsarea) (White, 1983) |
beta |
distance decay parameter |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing the distance-decay isolation index values for each group
Morgan, B. S. (1983) A Distance-Decay Based Interaction Index to Measure Residential Segregation. Area 15(3), pp. 211-217.
Interaction indices:
xPy
, DPxy
x <- segdata@data[ ,1:2] ar <- area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' DPxx(x, d = dist) DPxx(x, spatobj = segdata, diagval = 'a') DPxx(x, folder = foldername, shape = shapename, diagval = '0')
x <- segdata@data[ ,1:2] ar <- area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' DPxx(x, d = dist) DPxx(x, spatobj = segdata, diagval = 'a') DPxx(x, folder = foldername, shape = shapename, diagval = '0')
The distance decay interaction index, DPxy, is a
spatial adaptation of interaction index xPy
.
The function can be used in two ways: to provide a distance matrix
or a external geographic information source (spatial object or shape file).
DPxy(x, d = NULL, distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
DPxy(x, d = NULL, distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
d |
a matrix of the distances between spatial unit centroids |
distin |
input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
when providing a spatial object or a shape file, the user has the choice of the spatial matrix diagonal definition: diagval = '0' (by default) for an null diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial/organizational unitsarea) (White, 1983) |
beta |
distance decay parameter |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A matrix containing the distance-decay interaction index values for each pair of groups
Morgan, B. S. (1983) An Alternate Approach to the Development of a Distance-Based Measure of Racial Segregation. American Journal of Sociology 88, pp. 1237-1249.
Isolation indices:
xPx
, Eta2
, DPxx
Interaction index: xPy
x <- segdata@data[ ,1:2] ar <- area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' DPxy(x, d = dist) DPxy(x, spatobj = segdata, diagval = 'a') DPxy(x, folder = foldername, shape = shapename, diagval = '0')
x <- segdata@data[ ,1:2] ar <- area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' DPxy(x, d = dist) DPxy(x, spatobj = segdata, diagval = 'a') DPxy(x, folder = foldername, shape = shapename, diagval = '0')
The adjusted isolation index is the standardized
version of the isolation index, xPx
, which
controls for the effect of total population structure. Using
the approximate version of xPx, the adjusted index is equal
to Eta2 (the square of the correlation ratio) which, in the
case of the binomial variable, is identical to the square of
the mean square contingency coefficient phi. It can be used
as a segregation score and varies from 0 (minimum segregation)
to 1 (maximum segregation).
Eta2(x)
Eta2(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
A numeric vector containing the adjusted isolation index values for each group
Bell W. (1954) A probability model for the measurement of ecological segregation. Social Forces 32(4), pp. 357-364
Duncan O. D. and Duncan B. (1955) Residential Distribution and Occupational Stratification.. American Journal of Sociology 60 (5), pp. 493-503
Interaction indices:
xPy
, DPxy
x <- segdata@data[ ,1:2] Eta2(x)
x <- segdata@data[ ,1:2] Eta2(x)
The segregation version of the Gini index can be derived from the Lorenz curve as the area between the segregation curve and the diagonal.
Gini(x)
Gini(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
A numeric vector containing Gini's segregation index values for each group
Duncan O. D. and Duncan B. (1955) A Methodological Analysis of Segregation Indexes. American Sociological Review 41, pp. 210-217
Other one-group evenness indices:
ISDuncan
, Atkinson
, Gorard
,
HTheil
, 'ISWong
, ISMorrill
,
ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, Gini2
,
DIMorrill
, DIMorrillK
, DIWong
x <- segdata@data[ ,1:2] Gini(x)
x <- segdata@data[ ,1:2] Gini(x)
The between group version of Gini index is obtained by computing the index for a subpopulation formed by each pair of groups
Gini2(x)
Gini2(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
A matrix containing the between-group Gini index values for each pair of groups
Duncan O. D. and Duncan B. (1955) A Methodological Analysis of Segregation Indexes. American Sociological Review 41, pp. 210-217
Tivadar M. (2019) OasisR: An R Package to Bring Some Order to the World of Segregation Measurement. Journal of Statistical Software, 89 (7), pp 1-39
Other one-group evenness indices:
ISDuncan
, Gini
,
Gorard
, Atkinson
,
HTheil
, 'ISWong
, ISMorrill
,
ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, DIMorrill
,
DIMorrillK
, DIWong
x <- segdata@data[ ,1:2] Gini2(x)
x <- segdata@data[ ,1:2] Gini2(x)
multigroup Gini is a multigroup version of
the Gini
index
GiniMulti(x)
GiniMulti(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
The multigroup Gini index value (numeric)
Reardon S. F. (1998) Measures of racial diversity and segregation in multigroup and hierarchical structured Populations. Annual meeting of the Eastern Sociological Society, Philadelphia
multigroup indices:
PMulti
, GiniMulti
,
HMulti
, CMulti
, RelDivers
Social diversity indices:
HShannon
, NShannon
,
ISimpson
,
x <- segdata@data[ ,1:2] GiniMulti(x)
x <- segdata@data[ ,1:2] GiniMulti(x)
Gorard's index is an alternative to ISDuncan
's
index, which measures the dissimilarity between the distribution of a
group and the total population.
Gorard(x)
Gorard(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total totals because this will be interpreted as a group |
A numeric vector containing Gorard's segregation index values for each group
Gorard S. (2000) Education and Social Justice. Cardiff, University of Wales Press
One-group evenness indices:
ISDuncan
, Gini
, Atkinson
,
HTheil
, 'ISWong
, ISMorrill
,
ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, Gini2
,
DIMorrill
, DIMorrillK
, DIWong
x <- segdata@data[ ,1:2] Gorard(x)
x <- segdata@data[ ,1:2] Gorard(x)
This data set gives the households distribution by size in Grenoble urban area in 2011, including the area vectorial map at municipality level.
data(GreHSize)
data(GreHSize)
A Spatial object including 52 polygons corresponding to each municipality of Grenoble Urban Area (Insee definition) and following data attributes:
code: Municipality code
name: Municipality name
small: (1-2 persons household)
medium: (3-4 persons household)
big: (more then 5 persons household)
Insee: Resultats du recensement de la population 2011, Insee
Local diversity index, HLoc, is a local
adaptation of Pielou's normalized diversity index NShannon
.
HLoc(x)
HLoc(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
A numeric matrix containing the local diversity index values for each spatial unit
Theil H. (1972) Statistical Decomposition Analysis. North-Holland, Amsterdam
Other local indices LQ
LShannon
, LSimpson
x <- segdata@data[ ,1:2] HLoc(x)
x <- segdata@data[ ,1:2] HLoc(x)
The multigroup version of Theil's entropy index HTheil
HMulti(x)
HMulti(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
The multigroup entropy segregation index value (numeric)
Theil H. (1972) Statistical decomposition analysis: with applications in the social and administrative. Amsterdam, North-Holland, 337 p.
multigroup indices:
PMulti
, GiniMulti
, DMulti
,
CMulti
, RelDivers
Social diversity indices:
HShannon
, NShannon
,
ISimpson
,
x <- segdata@data[ ,1:2] HMulti(x)
x <- segdata@data[ ,1:2] HMulti(x)
The Shannon-Wiener diversity index is based on the notion of entropy and measures population heterogeneity.
HShannon(x)
HShannon(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
The Shannon-Wiener diversity index value (numeric)
Shannon C. E. (1948) A mathematical theory of communication. Bell System Technical Journal (27)
Social diversity indices:
NShannon
, ISimpson
,
multigroup indices:
PMulti
, GiniMulti
, DMulti
,
HMulti
, CMulti
, RelDivers
x <- segdata@data[ ,1:2] HShannon(x)
x <- segdata@data[ ,1:2] HShannon(x)
The entropy index (also called information index) measures departure from evenness by assessing each spatial unit deviation from the entropy in the area.
HTheil (x)
HTheil (x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
A numeric vector containing Theils's segregation index values for each group
Theil H. (1972) Statistical decomposition analysis: with applications in the social and administrative. Amsterdam, North-Holland, 337 p.
One-group evenness indices:
ISDuncan
, Gini
, Gorard
,
Atkinson
, 'ISWong
, ISMorrill
,
ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, Gini2
,
DIMorrill
, DIMorrillK
, DIWong
x <- segdata@data[ ,1:2] HTheil(x)
x <- segdata@data[ ,1:2] HTheil(x)
Duncan's segregation index is one-group form of
dissimilarity index DIDuncan
and
measures the unevenness of a group distribution
compared to the rest of the population. It can be interpreted
as the share of the group that would have to move to achieve
an even distribution compared to the rest of the population.
ISDuncan (x)
ISDuncan (x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
A numeric vector containing Duncan's segregation index values for each group
Duncan O. D. and Duncan B. (1955) Residential Distribution and Occupational Stratification. American Journal of Sociology 60 (5), pp. 493-503
One-group evenness indices:
Gini
, Atkinson
, Gorard
,
HTheil
, 'ISWong
, ISMorrill
,
ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, Gini2
,
DIMorrill
, DIMorrillK
, DIWong
x <- segdata@data[ ,1:2] ISDuncan(x)
x <- segdata@data[ ,1:2] ISDuncan(x)
Simpson's interaction index measures the probability that randomly selected individuals are not in the same group.
ISimpson(x)
ISimpson(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
The Simpson's interaction index value (numeric)
Simpson E. H. (1949) Measurement of diversity. Nature 163:688
Social diversity indices:
HShannon
, NShannon
,
multigroup indices:
PMulti
, GiniMulti
, DMulti
,
HMulti
, CMulti
, RelDivers
x <- segdata@data[ ,1:2] ISimpson(x)
x <- segdata@data[ ,1:2] ISimpson(x)
Morrill's segregation index is a development of
ISDuncan
's index which takes into account the
interactions between spatial units(contiguity).
The function can be used in two ways: to provide a contiguity
matrix or a external geographic information source (spatial object
or shape file).
ISMorrill(x, c = NULL, queen = FALSE, spatobj = NULL, folder = NULL, shape = NULL)
ISMorrill(x, c = NULL, queen = FALSE, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
c |
a standard binary contiguity (adjacency) symmetric matrix where each element Cij equals 1 if i-th and j-th spatial units are adjacent, and 0 otherwise. |
queen |
a logical parameter difining criteria used for the contiguity matrix computation, TRUE for queen, FALSE (by default) for rook |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension) . |
A numeric vector containing Morrill's segregation index values for each group
Morrill B. (1991) On the measure of geographic segregation. Geography research forum, 11, pp. 25-36.
One-group evenness indices:
ISDuncan
, Gini
, Gorard
,
HTheil
, Atkinson
, 'ISWong
,
ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, Gini2
,
DIMorrill
, DIMorrillK
, DIWong
x <- segdata@data[ ,1:2] contiguity <- contig(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ISMorrill(x, c = contiguity) ISMorrill(x, spatobj = segdata) ISMorrill(x, folder = foldername, shape = shapename)
x <- segdata@data[ ,1:2] contiguity <- contig(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ISMorrill(x, c = contiguity) ISMorrill(x, spatobj = segdata) ISMorrill(x, folder = foldername, shape = shapename)
This function computes an adaptation of Morrill's segregation index which takes into account the interactions between spatial units defined by K-th ordered contiguity matrix. The index can be used in two ways: to provide a contiguity units defined by K order contiguity matrix. The function can be used in two matrix or a external geographic information source (spatial object or shape file).
ISMorrillK(x, ck = NULL, queen = FALSE, spatobj = NULL, folder = NULL, shape = NULL, K = 2, f = 'exp', beta = 1, prec = NULL)
ISMorrillK(x, ck = NULL, queen = FALSE, spatobj = NULL, folder = NULL, shape = NULL, K = 2, f = 'exp', beta = 1, prec = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greaterTR than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
ck |
a list containing contiguity matrices coresponding to each order (from 1 to K) |
queen |
logical parameter defining criteria used for contiguity matrix computation, TRUE for queen, FALSE (by default) for rook |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the driveis located. |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
K |
the order of the contiguity matrix |
f |
the distance function, f = 'exp' (by default) for negative exponential function and f = 'rec' for reciprocal function |
beta |
distance decay parameter |
prec |
precision parameter. If not NULL, the function stop computing the spatial interaction when the impact on the indice is bellow 10 ^ (-prec) |
A numeric vector containing Generalized Morrill's segregation index values for each group
Morrill B. (1991) On the measure of geographic segregation. Geography research forum, 11, pp. 25-36.
Tivadar M. (2019) OasisR: An R Package to Bring Some Order to the World of Segregation Measurement. Journal of Statistical Software, 89 (7), pp 1-39
One-group evenness indices:
ISDuncan
, Gini
, Gorard
,
HTheil
, Atkinson
, 'ISWong
,
ISMorrill
Between groups dissimilarity indices:
DIDuncan
, Gini2
,
DIMorrill
, DIMorrillK
, DIWong
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ISMorrillK(x, spatobj = segdata, queen = FALSE, K = 3) ISMorrillK(x, folder = foldername, shape = shapename, K = 4, f = 'rec')
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ISMorrillK(x, spatobj = segdata, queen = FALSE, K = 3) ISMorrillK(x, folder = foldername, shape = shapename, K = 4, f = 'rec')
Wong's segregation index is a development of
ISDuncan
's which takes into account the interactions
between spatial units (common boundaries and perimeter/area ratio).
The function can be used in two ways: to provide spatial data (
boundaries matrix, a perimeter vector and an area vector)
or a external geographic information source (spatial object or shape file).
ISWong(x, b = NULL, a = NULL, p = NULL, ptype = 'int', variant = 's', spatobj = NULL, folder = NULL, shape = NULL)
ISWong(x, b = NULL, a = NULL, p = NULL, ptype = 'int', variant = 's', spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total totals because this will be interpreted as a group |
b |
a common boundaries matrix where each element Bij equals the shared boundary of i-th and j-th spatial units. |
a |
a numeric vector containing spatial unit areas |
p |
a numeric vector containing spatial units perimeters. |
ptype |
a string variable giving two options for perimeter calculation when a spatial object or shapefile is provided: 'int' to use only interior boundaries of spatial units, and 'all' to use entire boundaries, including the boundaries to the exterior |
variant |
a character variable that allows to choose the index version: variant = 's' for the index adjusted for contiguous spatial/organizational units boundary lengths and perimeter/area ratio (by default) and variant = 'w' for the version based only on shared boundaries length |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing Wong's segregation index values for each group
Wong D. W. S. (1998) Measuring multiethnic spatial segregation. Urban Geography, 19 (1), pp. 77-87.
One-group evenness indices:
ISDuncan
, Gini
, Gorard
,
HTheil
, 'Atkinson
, ISMorrill
,
ISMorrillK
Between groups dissimilarity indices:
DIDuncan
, Gini2
,
DIMorrill
, DIMorrillK
, DIWong
x <- segdata@data[ ,1:2] bound <- boundaries(segdata) per <- perimeter(segdata) ar <- area(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ISWong(x, b = bound, p = per, a = ar) ISWong(x, spatobj = segdata, variant = 's', ptype = 'int') ISWong(x, folder = foldername, shape = shapename, variant = 'w')
x <- segdata@data[ ,1:2] bound <- boundaries(segdata) per <- perimeter(segdata) ar <- area(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' ISWong(x, b = bound, p = per, a = ar) ISWong(x, spatobj = segdata, variant = 's', ptype = 'int') ISWong(x, folder = foldername, shape = shapename, variant = 'w')
Location quotients compare the relative part of a group in a particular spatial unit, to the relative part of that same group in the area.
LQ(x)
LQ(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
A matrix containing the location quotients for each group in each spatial unit
Isard W. (1960) Methods of regional analysis: an introduction to regional science. The MIT Press, Cambridge
Other local indices LShannon
HLoc
, LSimpson
x <- segdata@data[ ,1:2] LQ(x)
x <- segdata@data[ ,1:2] LQ(x)
The Shannon-Wiener diversity index is based on the notion of entropy and measures population heterogeneity.
LShannon(x)
LShannon(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
A vector containing the local Shannon-Wiener diversity index values for each spatial unit
Shannon C. E. (1948) A mathematical theory of communication. Bell System Technical Journal (27)
Other local indices: LQ
,
HLoc
, LSimpson
x <- segdata@data[ ,1:2] LShannon(x)
x <- segdata@data[ ,1:2] LShannon(x)
Local Simpson's interaction index measures the probability that randomly selected individuals are not in the same group in each spatial unit.
LSimpson (x)
LSimpson (x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
A vector containing the local Simpson's interaction index values for each spatial unit
Simpson E. H. (1949) Measurement of diversity. Nature 163:688
Other local indices: LQ
,
HLoc
, LShannon
x <- segdata@data[ ,1:2] LSimpson (x)
x <- segdata@data[ ,1:2] LSimpson (x)
The Shannon-Wiener diversity index is based on the notion of entropy and measures population heterogeneity.
NShannon(x)
NShannon(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
The Shannon-Wiener normalized diversity index value (numeric)
Shannon C. E. (1948) A mathematical theory of communication. Bell System Technical Journal (27)
Other multigroup eveness indices:
HShannon
, ISimpson
,
GiniMulti
, DMulti
, HMulti
,
CMulti
Other multigroup indices: PMulti
,
RelDivers
x <- segdata@data[ ,1:2] NShannon(x)
x <- segdata@data[ ,1:2] NShannon(x)
A function to compute Reardon (2009) ordinal indices
ordinalseg(x)
ordinalseg(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. The rows represent the nominal categories (spatial units) and the columns the ordinal categories. |
A vector containing Reardon's multigroup ordinal segregation indices: Lambda1 (the ordinal generalization of the information theory index), Lambda2 (the ordinal generalization of the variation ratio index), Lambda3 (the ordinal square root index), and Lambda4 (the ordinal absolute difference index)
Reardon S. F. (2009) Measures of ordinal segregation. Research on Economic Inequality, 17, pp. 129-155.
x <- GreHSize@data[ ,3:5] ordinalseg(x) x1 <- matrix(nrow = 4, ncol = 3) x1[1,] <- c(0, 0, 30) x1[2,] <- c(0, 20, 10) x1[3,] <- c(10, 20 ,0) x1[4,] <- c(30, 0 ,0) x2 <- matrix(nrow = 4, ncol = 3) x2[1,] <- c(0, 30, 0) x2[2,] <- c(0, 10, 20) x2[3,] <- c(10, 0, 20) x2[4,] <- c(30, 0, 0) ordinalseg(x1) ordinalseg(x2)
x <- GreHSize@data[ ,3:5] ordinalseg(x) x1 <- matrix(nrow = 4, ncol = 3) x1[1,] <- c(0, 0, 30) x1[2,] <- c(0, 20, 10) x1[3,] <- c(10, 20 ,0) x1[4,] <- c(30, 0 ,0) x2 <- matrix(nrow = 4, ncol = 3) x2[1,] <- c(0, 30, 0) x2[2,] <- c(0, 10, 20) x2[3,] <- c(10, 0, 20) x2[4,] <- c(30, 0, 0) ordinalseg(x1) ordinalseg(x2)
The function is based on on sf package and can be used with a shape file or an R spatial object (class sf, sfc or sfg).
perimeter(spatobj = NULL, folder = NULL, shape = NULL)
perimeter(spatobj = NULL, folder = NULL, shape = NULL)
spatobj |
a spatial object (class sf, sfc or sfg) containing geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile with the geographic information is located. |
shape |
a character vector with the name of the shapefile (without the .shp extension) which contains the geographic information |
A vector containing the perimeter of spatial units
Other spatial functions used for segregation indices
computation: area
, contig
,
distance
, distcenter
,
boundaries
perimeter(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' perimeter(folder = foldername, shape = shapename)
perimeter(segdata) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' perimeter(folder = foldername, shape = shapename)
The multigroup normalised isolation index is a
multigroup version of the isolation index (xPx
)
PMulti(x)
PMulti(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
The multigroup normalised isolation index value (numeric)
James, F. J. (1986) A New Generalized 'Exposure-Based' Segregation Index. Sociological Methods and Research, 14, pp. 301-316
Reardon S. F. and G. Firebaugh (2002) Measures of multigroup Segregation. Sociological Methodology, 32(1), pp 33-67
multigroup indices:
GiniMulti
, DMulti
,
HMulti
, CMulti
, RelDivers
Social diversity indices:
HShannon
, NShannon
,
ISimpson
,
x <- segdata@data[ ,1:2] PMulti(x)
x <- segdata@data[ ,1:2] PMulti(x)
Mean proximity, Poo, computes the mean distance between the individuals in the area with no regard for group. The function can be used in two ways: to provide a distance matrix or a external geographic information source (spatial object or shape file)
Poo(x, d = NULL, fdist = 'e', distin = 'm', distout = 'm', diagval = '0', itype = 'multi', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
Poo(x, d = NULL, fdist = 'e', distin = 'm', distout = 'm', diagval = '0', itype = 'multi', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
d |
a matrix of the distances between spatial unit centroids |
fdist |
the method used for distance interaction matrix: e' for inverse exponential function (by default) and 'l' for linear. |
distin |
input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
when providing a spatial object or a shape file, the user has the choice of the spatial matrix diagonal definition: diagval = '0' (by default) for an null diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial/organizational unitsarea) (White, 1983) |
itype |
a character string defining the index type: itype = 'multi' (by default) for the multigroup index (White, 1986) or itype = 'between' for the between groups version (White, 1983) |
beta |
distance decay parameter |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
The Poo index value (numeric)
White M. J. (1983) The Measurement of Spatial Segregation. American Journal of Sociology, 88, p. 1008-1019
White, M. J. (1986) Segregation and Diversity Measures in Population DistributionE. Population Index 52(2): 198-221.
Proximity measures: Pxx
,
Pxy
, SP
x <- segdata@data[ ,1:2] ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' Poo(x, spatobj = segdata) Poo(x, folder = foldername, shape = shapename, fdist = 'l') Poo(x, spatobj = segdata, diagval ='a') Poo(x, d = dist, fdist = 'e')
x <- segdata@data[ ,1:2] ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' Poo(x, spatobj = segdata) Poo(x, folder = foldername, shape = shapename, fdist = 'l') Poo(x, spatobj = segdata, diagval ='a') Poo(x, d = dist, fdist = 'e')
Mean proximity, Pxx, computes the mean distance between the members of a group. The distance matrix can be expressed as a linear or as an inverse exponential function of the distance between spatial unit centroids.The function can be used in two ways: to provide a distance matrix or a external geographic information source (spatial object or shape file).
Pxx(x, d = NULL, fdist = 'e', distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
Pxx(x, d = NULL, fdist = 'e', distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
d |
a matrix of the distances between spatial unit centroids |
fdist |
the method used for distance interaction matrix: e' for inverse exponential function (by default) and 'l' for linear. |
distin |
input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
when providing a spatial object or a shape file, the user has the choice of the spatial matrix diagonal definition: diagval = '0' (by default) for an null diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial/organizational unitsarea) (White, 1983) |
beta |
distance decay parameter |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A numeric vector containing the Pxx index values for each group
White M. J. (1983) The Measurement of Spatial Segregation. American Journal of Sociology, 88, p. 1008-1019
Proximity measures:
Pxy
, Poo
, SP
x <- segdata@data[ ,1:2] ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' Pxx(x, spatobj = segdata) Pxx(x, folder = foldername, shape = shapename, fdist = 'l') Pxx(x, spatobj = segdata, diagval ='a') Pxx(x, d = dist, fdist = 'e')
x <- segdata@data[ ,1:2] ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' Pxx(x, spatobj = segdata) Pxx(x, folder = foldername, shape = shapename, fdist = 'l') Pxx(x, spatobj = segdata, diagval ='a') Pxx(x, d = dist, fdist = 'e')
Mean proximity, Pxy, computes the mean distance between the members of different groups.The function can be used in two ways: to provide a distance matrix or a external geographic information source (spatial object or shape file).
Pxy(x, d = NULL, fdist = 'e', distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
Pxy(x, d = NULL, fdist = 'e', distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
d |
a matrix of the distances between spatial unit centroids |
fdist |
the method used for distance interaction matrix: e' for inverse exponential function (by default) and 'l' for linear. |
distin |
input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
when providing a spatial object or a shape file, the user has the choice of the spatial matrix diagonal definition: diagval = '0' (by default) for an null diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial/organizational unitsarea) (White, 1983) |
beta |
distance decay parameter |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A matrix containing the Pxy index values for each pair of groups
White M. J. (1983) The Measurement of Spatial Segregation. American Journal of Sociology, 88, p. 1008-1019
Proximity measures: Pxx
,
Poo
, SP
x <- segdata@data[ ,1:2] ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' Pxy(x, spatobj = segdata) Pxy(x, folder = foldername, shape = shapename, fdist = 'l') Pxy(x, spatobj = segdata, diagval ='a') Pxy(x, d = dist, fdist = 'e')
x <- segdata@data[ ,1:2] ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' Pxy(x, spatobj = segdata) Pxy(x, folder = foldername, shape = shapename, fdist = 'l') Pxy(x, spatobj = segdata, diagval ='a') Pxy(x, d = dist, fdist = 'e')
A function computing Reardon (2011) rank-ordered segregation indices
rankorderseg(x, polorder = 4, pred = NULL)
rankorderseg(x, polorder = 4, pred = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. The rows represent the nominal categories (spatial units) and the columns the population distribution as ordered groups divided by thresholds |
polorder |
order of the polynomial approximation (4 by default) |
pred |
a numerical vector with percentiles to be predicted. If NULL, the predictions are made at threshold levels |
A list containing the results for three rank-ordered indices: rank-order information theory index (Hr), rank-order variation ratio index (Rr) and rank-order square root index (Sr). For each index, a sublist is provided, containing: Index (the rank-ordered index value), Hp/Rp/Sp (a vector containing the ordinal information theory/variance ratio/square root segregation index values at thresholds), Coefficients (the coefficients extracted from the polynomial estimation model, including basic statistics), Predict (a list containing predicted values of the corresponding ordinal index (fit); standard error of predicted means (se.fit); degrees of freedom for residual (df); and residual standard deviations (residuale.scale). If pred is NULL, the function will return the statistics at thresholds)
Reardon S. F. (2011) Measures of Income Segregation . The Stanford Center on Poverty and Inequality
x1 <- matrix(nrow = 4, ncol = 7) x1[1,] <- c( 10, 10, 10, 20, 30, 40, 50) x1[2,] <- c( 0, 20, 10, 10, 10, 20, 20) x1[3,] <- c(10, 20, 10, 10, 10, 0, 0 ) x1[4,] <- c(30, 30, 20, 10, 10, 0, 0 ) x2 <- x1 x2[,c(3,4,6,7)] <- x1[,c(6,7,3,4)] rankorderseg(x1) rankorderseg(x2, pred = seq(0, 1, 0.1))
x1 <- matrix(nrow = 4, ncol = 7) x1[1,] <- c( 10, 10, 10, 20, 30, 40, 50) x1[2,] <- c( 0, 20, 10, 10, 10, 20, 20) x1[3,] <- c(10, 20, 10, 10, 10, 0, 0 ) x1[4,] <- c(30, 30, 20, 10, 10, 0, 0 ) x2 <- x1 x2[,c(3,4,6,7)] <- x1[,c(6,7,3,4)] rankorderseg(x1) rankorderseg(x2, pred = seq(0, 1, 0.1))
The relative centralisation index measures the proportion of a group that should change its localization to achieve the same level of centralization as another group. The function can be used in two ways: to provide a vector containing the distances between spatial unit centroids or a external geographic information source (spatial object or shape file).
RCE(x, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
RCE(x, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
dc |
a numeric vector containing the distances between spatial units centroids and the central spatial unit |
center |
a numeric value giving the number of the spatial unit that represents the center in the table |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A matrix containing the relative centralisation index values for each pair of groups
Duncan O. D. and Duncan B. (1955) A Methodological Analysis of Segregation Indexes. American Sociological Review 41, pp. 210-217
x <- segdata@data[ ,1:2] distc<- distcenter(segdata, center = 28) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' RCE(x, dc=distc) RCE(x, spatobj = segdata, center = 28) RCE(x, folder = foldername, shape = shapename, center = 28)
x <- segdata@data[ ,1:2] distc<- distcenter(segdata, center = 28) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' RCE(x, dc=distc) RCE(x, spatobj = segdata, center = 28) RCE(x, folder = foldername, shape = shapename, center = 28)
The polycentric version of the relative centralisation index. The function can be used in two ways: to provide a matrix containing the distances between spatial/organizational unit centroids or a external geographic information source (spatial object or shape file).
RCEPoly(x, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
RCEPoly(x, dc = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
dc |
a numeric matrix/vector containing the distances between spatial units centroids and the central spatial unit(s). |
center |
a numeric vector giving the number of the spatial units that represent the centers in the table |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A matrix containing the polycentric relative centralisation index values for each pair of groups
Duncan O. D. and Duncan B. (1955) A Methodological Analysis of Segregation Indexes. American Sociological Review 41, pp. 210-217
Tivadar M. (2019) OasisR: An R Package to Bring Some Order to the World of Segregation Measurement. Journal of Statistical Software, 89 (7), pp 1-39
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' RCEPoly(x, spatobj = segdata, center = c(28, 83) ) RCEPoly(x, folder = foldername, shape = shapename, center = c(28, 83)) center <- c(28, 83) polydist <- matrix(data = NA, nrow = nrow(x), ncol = length(center)) for (i in 1:ncol(polydist)) polydist[,i] <- distcenter(spatobj = segdata, center = center[i]) RCEPoly(x, dc = polydist) distmin <- vector(length = nrow(x)) for (i in 1:nrow(polydist)) distmin[i] <- min(polydist[i,]) RCE(x, dc = distmin)
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' RCEPoly(x, spatobj = segdata, center = c(28, 83) ) RCEPoly(x, folder = foldername, shape = shapename, center = c(28, 83)) center <- c(28, 83) polydist <- matrix(data = NA, nrow = nrow(x), ncol = length(center)) for (i in 1:ncol(polydist)) polydist[,i] <- distcenter(spatobj = segdata, center = center[i]) RCEPoly(x, dc = polydist) distmin <- vector(length = nrow(x)) for (i in 1:nrow(polydist)) distmin[i] <- min(polydist[i,]) RCE(x, dc = distmin)
The constrained (local) version of relative centralization index. The function can be used in two ways: to provide a matrix containing the distances between spatial unit centroids or a external geographic information source (spatial object or shape file).
RCEPolyK(x, dc = NULL, K = NULL, kdist = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
RCEPolyK(x, dc = NULL, K = NULL, kdist = NULL, center = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
dc |
a numeric matrix/vector containing the distances between spatial units centroids and the central spatial unit(s). |
K |
the number of neighbourhoods under the influence of a center |
kdist |
the maximal distance that defines the neighbourhoods influenced by a center |
center |
a numeric vector giving the number of the spatial units that represent the centers in the table |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
a matrix containing the constrainted polycentric relative centralisation index values for each pair of groups
Duncan O. D. and Duncan B. (1955) A Methodological Analysis of Segregation Indexes. American Sociological Review 41, pp. 210-217
Folch D.C and Rey S. J (2016) The centralization index: A measure of local spatial segregation. Papers in Regional Science 95 (3), pp. 555-576
Tivadar M. (2019) OasisR: An R Package to Bring Some Order to the World of Segregation Measurement. Journal of Statistical Software, 89 (7), pp 1-39
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' RCEPolyK(x, spatobj = segdata, center = c(28, 83)) RCEPolyK(x, folder = foldername, shape = shapename, center = c(28, 83), K = 3) center <- c(28, 83) polydist <- matrix(data = NA, nrow = nrow(x), ncol = length(center)) for (i in 1:ncol(polydist)) polydist[,i] <- distcenter(spatobj = segdata, center = center[i]) RCEPolyK(x, dc = polydist, kdist = 2)
x <- segdata@data[ ,1:2] foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' RCEPolyK(x, spatobj = segdata, center = c(28, 83)) RCEPolyK(x, folder = foldername, shape = shapename, center = c(28, 83), K = 3) center <- c(28, 83) polydist <- matrix(data = NA, nrow = nrow(x), ncol = length(center)) for (i in 1:ncol(polydist)) polydist[,i] <- distcenter(spatobj = segdata, center = center[i]) RCEPolyK(x, dc = polydist, kdist = 2)
The relative clustering index, RCL, compares the mean proximity of a group to the mean proximity of another group. The function can be used in two ways: to provide a distance matrix or a external geographic information source (spatial object or shape file).
RCL(x, d = NULL, fdist = 'e', distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
RCL(x, d = NULL, fdist = 'e', distin = 'm', distout = 'm', diagval = '0', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
d |
a matrix of the distances between spatial unit centroids |
fdist |
the method used for distance interaction matrix: e' for inverse exponential function (by default) and 'l' for linear. |
distin |
input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
when providing a spatial object or a shape file, the user has the choice of the spatial matrix diagonal definition: diagval = '0' (by default) for an null diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial/organizational unitsarea) (White, 1983) |
beta |
distance decay parameter |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A matrix containing the relative clustering index values for each pair of groups
Massey D. S. and Denton N. A. (1988) The dimensions of residential segregation. Social Forces 67(2), pp. 281-315.
Proximity measures: Pxx
,
Pxy
, Poo
, SP
Clustering Indices: ACL
x <- segdata@data[ ,1:2] ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' RCL(x, spatobj = segdata) RCL(x, folder = foldername, shape = shapename, fdist = 'l') RCL(x, spatobj = segdata, diagval ='a') RCL(x, d = dist, fdist = 'e')
x <- segdata@data[ ,1:2] ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' RCL(x, spatobj = segdata) RCL(x, folder = foldername, shape = shapename, fdist = 'l') RCL(x, spatobj = segdata, diagval ='a') RCL(x, d = dist, fdist = 'e')
The relative concentration index, measures the share of space occupied by a group compared to another group. The function can be used in two ways: to provide an area vector or a external geographic information source (spatial object or shape file).
RCO(x, a = NULL, spatobj = NULL, folder = NULL, shape = NULL)
RCO(x, a = NULL, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
a |
a numeric vector containing spatial unit areas |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
A matrix containing the relative concentration index values for each pair of groups
Massey D. S. and Denton N. A. (1988) The dimensions of residential segregation. Social Forces 67(2), pp. 281-315.
one-group concentration indices:
Delta
, ACO
x <- GreHSize@data[ ,3:5] ar <- area(GreHSize) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'GreHSize' RCO(x, a = ar) RCO(x, spatobj = GreHSize) RCO(x, folder = foldername, shape = shapename)
x <- GreHSize@data[ ,3:5] ar <- area(GreHSize) foldername <- system.file('extdata', package = 'OasisR') shapename <- 'GreHSize' RCO(x, a = ar) RCO(x, spatobj = GreHSize) RCO(x, folder = foldername, shape = shapename)
The relative diversity index is a multigroup
index based on Simpson's interaction index ISimpson
RelDivers(x)
RelDivers(x)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
The multigroup relative diversity index value (numeric)
Carlson S. M. (1992) Trends in race/sex occupational inequality: conceptual and measurement issues. Social Problems, 39, p. 269-290
multigroup indices:
PMulti
, GiniMulti
, DMulti
,
HMulti
, CMulti
Social diversity indices:
HShannon
, NShannon
,
ISimpson
,
x <- segdata@data[ ,1:2] RelDivers(x)
x <- segdata@data[ ,1:2] RelDivers(x)
Plot of Monte Carlo simulations results. The function can
be used in two ways: buy providing a ResampleTest object, using ResampleTest
or a simulated distribution vector, a value and a name of the index
ResamplePlot(ResampleTest, var = 1, coldist = 'red', colind = 'blue', legend = TRUE, legendpos = 'top', cex.legend = 1, bty = 'o')
ResamplePlot(ResampleTest, var = 1, coldist = 'red', colind = 'blue', legend = TRUE, legendpos = 'top', cex.legend = 1, bty = 'o')
ResampleTest |
- a ResampleTest object prodused with |
var |
the number of the variable to be plot |
coldist |
color used to plot the simulated distribution |
colind |
color used to plot the index |
legend |
logical parameter, to control the legend's plots |
legendpos |
a character string giving the legend's position: 'bottomright', 'bottom', 'bottomleft', 'left', 'topleft', 'top', 'topright', 'right' and 'center'. |
cex.legend |
a numerical value giving the amount by which plotting text and symbols in legend should be magnified relative to the default. |
bty |
a character string which determines the type of box of the legend. If bty is one of 'o' (the default), 'l', '7', 'c', 'u', or ']' the resulting box resembles the corresponding upper case letter. A value of 'n' suppresses the box. |
A plot with resampling theoretical distribution
Tivadar M. (2019) OasisR: An R Package to Bring Some Order to the World of Segregation Measurement. Journal of Statistical Software, 89 (7), pp 1-39
x <- segdata@data[ ,1:2] xtest <- ResampleTest (x, fun ='ISMorrill', simtype = 'MonteCarlo', sampleunit = 'unit', spatobj = segdata) ResamplePlot(xtest, var = 1)
x <- segdata@data[ ,1:2] xtest <- ResampleTest (x, fun ='ISMorrill', simtype = 'MonteCarlo', sampleunit = 'unit', spatobj = segdata) ResamplePlot(xtest, var = 1)
Resampling tests for segregation indexes.
ResampleTest( x, fun, var = NULL, simtype = "MonteCarlo", sampleunit = "unit", samplesize = NULL, perc = c(0.05, 0.95), outl = FALSE, outmeth = "bp", sdtimes = 2, IQRrange = 1.5, proba = NULL, nsim = NULL, spatobj = NULL, folder = NULL, shape = NULL, delta = 0.5, exact = FALSE, d = NULL, c = NULL, a = NULL, ck = NULL, f = "exp", b = NULL, p = NULL, spatmat = "c", queen = FALSE, distin = "m", distout = "m", diagval = "0", fdist = "e", itype = "multi", dc = NULL, center = 1, polorder = 4, pred = NULL, K = 2, ptype = "int", variant = "s", ... )
ResampleTest( x, fun, var = NULL, simtype = "MonteCarlo", sampleunit = "unit", samplesize = NULL, perc = c(0.05, 0.95), outl = FALSE, outmeth = "bp", sdtimes = 2, IQRrange = 1.5, proba = NULL, nsim = NULL, spatobj = NULL, folder = NULL, shape = NULL, delta = 0.5, exact = FALSE, d = NULL, c = NULL, a = NULL, ck = NULL, f = "exp", b = NULL, p = NULL, spatmat = "c", queen = FALSE, distin = "m", distout = "m", diagval = "0", fdist = "e", itype = "multi", dc = NULL, center = 1, polorder = 4, pred = NULL, K = 2, ptype = "int", variant = "s", ... )
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
fun |
a character vector with the segregation function to be tested |
var |
vector with the variables to be tested |
simtype |
a character vector with the type of simulation. If simtype = 'Boot', the function generates bootstrap replications If simtype = 'Jack', the function generates jackknife replications If simtype = 'MonteCarlo', the function produces a randomization test using Monte Carlo simulations |
sampleunit |
= 'unit' (by default) when the sampling unit is the spatial/organisational unit and sampleunit = 'ind' for individual sampling |
samplesize |
the size of the sample used for bootstraping. If null, the samplesize equals the number of spatial/organizational units(sampleunit = 'unit') or the total total population (sampleunit = 'ind') |
perc |
the percentiles for the bootstrap replications |
outl |
logical parameter for jackknife simulations, if TRUE the function provides the outliers obtained by jackknife iterations |
outmeth |
- a character vector designing the outliers detection method: outmeth = 'bp' (by default) for boxplot method, outmeth = 'sd' for standard deviation method, outmeth = 'z' for normal scores method, outmeth = 't' for t Student scores method, outmeth = 'chisq' for chi-squared scores method, outmeth = 'mad' for median absolute deviation method. The estimations based on scoring methods are obtained using outliers package |
sdtimes |
multiplication factor of the standard deviation used for outliers detection with jackknife simulations (2 by default) |
IQRrange |
determines the boxplot thresholds (1.5 by default) as multiplication of IQR (Inter Quartile Range) |
proba |
for Monte Carlo simulations, proba is a vector with location probabilities. If proba = NULL, the vector is equiprobable. If outliers are determined with jackknife technique, proba indicates the probability (confidence interval) for scoring tests. |
nsim |
the number of simulations |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
delta |
an inequality aversion parameter |
exact |
a logical variable to specifiy the index version: exact = FALSE (by default) for the approximate version of the index, and exact = TRUE for the exact version |
d |
a matrix of the distances between spatial unit centroids |
c |
a standard binary contiguity (adjacency) symmetric matrix where each element Cij equals 1 if i-th and j-th spatial units are adjacent, and 0 otherwise. |
a |
a numeric vector containing spatial unit areas |
ck |
a list containing contiguity matrices coresponding to each order (from 1 to K) |
f |
the distance function, f = 'exp' (by default) for negative exponential function and f = 'rec' for reciprocal function |
b |
a common boundaries matrix where each element Bij |
p |
a numeric vector containing spatial units perimeters. |
spatmat |
the method used for spatial calculations: 'c' for the contiguity matrix (by default) or any other user spatial interaction matrix and 'd' for the inverse exponential function of the distance. |
queen |
logical parameter defining criteria used for contiguity matrix computation, TRUE for queen, FALSE (by default) for rook |
distin |
input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
when providing a spatial object or a shape file, the user has the choice of the spatial matrix diagonal definition: diagval = '0' (by default) for an null diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial/organizational unitsarea) (White, 1983) |
fdist |
the method used for distance interaction matrix: e' for inverse exponential function (by default) and 'l' for linear. |
itype |
a character string defining the index type: itype = 'multi' (by default) for the multigroup index (White, 1986) or itype = 'between' for the between groups version (White, 1983) |
dc |
a numeric vector containing the distances between spatial units centroids and the central spatial unit |
center |
a numeric value giving the number of the spatial unit that represents the center in the table |
polorder |
order of the polynomial approximation (4 by default) |
pred |
a numerical vector with percentiles to be predicted. |
K |
the order of the contiguity matrix |
ptype |
a string variable giving two options for perimeter calculation when a spatial object or shapefile is provided: 'int' to use only interior boundaries of spatial units, and 'all' to use entire boundaries, including the boundaries to the exterior |
variant |
a character variable that allows to choose the index version: variant = 's' for the dissimilarity index adjusted for contiguous spatial units boundary lengths and perimeter/area ratio (by default) and variant = 'w' for the version without perimeter/area ratio |
... |
other specific parameters |
A list including: the index's name, the simulation type, the summary statistics of the simulations, the simulated index distribution, the simulated population distribution, a matrix with outliers (jackknife), a list with outliers values (jackknife)
Efron, B., and Tibshirani, R. J. (1993). An Introduction to the Bootstrap. New York, Chapman and Hall
Tivadar M. (2019) OasisR: An R Package to Bring Some Order to the World of Segregation Measurement. Journal of Statistical Software, 89 (7), pp 1-39
x <- segdata@data[ ,1:2] xtest <- ResampleTest (x, fun ='ISMorrill', simtype = 'MonteCarlo', sampleunit = 'ind', spatobj = segdata) xtest$Summary xtest <- ResampleTest (x, fun ='ISMorrill', simtype = 'Boot', sampleunit = 'unit', spatobj = segdata) xtest$Summary xtest <- ResampleTest (GreHSize@data[,3:5], fun='ISDuncan', simtype = 'Jack', sampleunit = 'unit', spatobj = GreHSize, outl = TRUE, outmeth = 'sd', sdtimes = 3) xtest$Summary xtest$OutliersVal
x <- segdata@data[ ,1:2] xtest <- ResampleTest (x, fun ='ISMorrill', simtype = 'MonteCarlo', sampleunit = 'ind', spatobj = segdata) xtest$Summary xtest <- ResampleTest (x, fun ='ISMorrill', simtype = 'Boot', sampleunit = 'unit', spatobj = segdata) xtest$Summary xtest <- ResampleTest (GreHSize@data[,3:5], fun='ISDuncan', simtype = 'Jack', sampleunit = 'unit', spatobj = GreHSize, outl = TRUE, outmeth = 'sd', sdtimes = 3) xtest$Summary xtest$OutliersVal
The theoretical examples ( Morrill 1991, Wong 1993) adapted from Hong and O'Sullivan (2015). The space is represented by a 10x10 checkboard, with different distributions of two social groups in the area.
data(segdata)
data(segdata)
A 10x10 grid Spatial object and following data attributes:
: spatial ID;
: municipality name;
: pattern A: minority distribution;
: pattern A: majority distribution;
: pattern B: minority distribution;
: pattern B: majority distribution;
: pattern C: minority distribution;
: pattern C: majority distribution;
: pattern D: minority distribution;
: pattern D: majority distribution;
: pattern E: minority distribution;
: pattern E: majority distribution;
: pattern F: minority distribution;
: pattern F: majority distribution;
: pattern G: minority distribution;
: pattern G: majority distribution;
: pattern H: minority distribution;
: pattern H: majority distribution;
: pattern I: minority distribution;
: pattern I: majority distribution;
The function cleans and prepares the data for segregation analysis
segdataclean (x, c = NULL, b = NULL, a = NULL, p = NULL, ck = NULL, d = NULL, dc = NULL, spatobj = NULL, folder = NULL, shape = NULL, warnings = TRUE)
segdataclean (x, c = NULL, b = NULL, a = NULL, p = NULL, ck = NULL, d = NULL, dc = NULL, spatobj = NULL, folder = NULL, shape = NULL, warnings = TRUE)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
c |
a standard binary contiguity (adjacency) symmetric matrix where each element Cij equals 1 if i-th and j-th spatial units are adjacent, and 0 otherwise. |
b |
a common boundaries matrix where each element Bij |
a |
a numeric vector containing spatial unit areas |
p |
a numeric vector containing spatial units perimeters. |
ck |
a list containing contiguity matrices coresponding to each order (from 1 to K) |
d |
a matrix of the distances between spatial unit centroids |
dc |
a numeric vector containing the distances between spatial units centroids and the central spatial unit |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
warnings |
- warning alert (by default TRUE) |
The objects (data matrix, geographical vectors/matrices, spatial objects) cleaned from null rows or columns
Other local indices: LQ
,
HLoc
, LShannon
x <- segdata@data[ ,1:2] x[ ,3] <- rep (0 ,100) x[1:3, ] <- rep (c(0, 0, 0), 3) x1 <- x spatobj <- segdata cldata <- segdataclean(x1, segdata) x1 <- cldata$x spatobj <- cldata$spatobj c <- contig (segdata) c <- segdataclean(x, c = c)$c
x <- segdata@data[ ,1:2] x[ ,3] <- rep (0 ,100) x[1:3, ] <- rep (c(0, 0, 0), 3) x1 <- x spatobj <- segdata cldata <- segdataclean(x1, segdata) x1 <- cldata$x spatobj <- cldata$spatobj c <- contig (segdata) c <- segdataclean(x, c = c)$c
The spatial proximity index, SP, compares the clustering level (mean proximity) of a group compared to another group. The function can be used in two ways: to provide a distance matrix or a external geographic information source (spatial object or shape file).
SP(x, d = NULL, fdist = 'e', distin = 'm', distout = 'm', diagval = '0', itype = 'multi', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
SP(x, d = NULL, fdist = 'e', distin = 'm', distout = 'm', diagval = '0', itype = 'multi', beta = 1, spatobj = NULL, folder = NULL, shape = NULL)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
d |
a matrix of the distances between spatial unit centroids |
fdist |
the method used for distance interaction matrix: e' for inverse exponential function (by default) and 'l' for linear. |
distin |
input metric conversion, based on bink package and includes conversions from 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
distout |
output metric conversion, based on bink package and includes conversions to 'm', 'km', 'inch', 'ft', 'yd', 'mi', 'naut_mi', etc. |
diagval |
when providing a spatial object or a shape file, the user has the choice of the spatial matrix diagonal definition: diagval = '0' (by default) for an null diagonal and diagval = 'a' to compute the diagonal as 0.6 * square root (spatial/organizational unitsarea) (White, 1983) |
itype |
a character string defining the index type: itype = 'multi' (by default) for the multigroup index (White, 1986), itype = 'between' for the between groups version (White, 1983), or itype = 'one' for the one-group version (Apparicio et al, 2008) |
beta |
distance decay parameter |
spatobj |
a spatial object (SpatialPolygonsDataFrame) with geographic information |
folder |
a character vector with the folder (directory) name indicating where the shapefile is located on the drive |
shape |
a character vector with the name of the shapefile (without the .shp extension). |
If itype = 'multi' the function returns the multigroup spatial proximity index value (numeric). If itype = 'between', the function returns a matrix containing the between group values of the index. If itype = 'one', the function's output is a numeric vector containing the index values for each group
White M. J. (1983) The Measurement of Spatial Segregation. American Journal of Sociology, 88, p. 1008-1019.
White, M. J. (1986) Segregation and Diversity Measures in Population DistributionE. Population Index 52(2): 198-221.
Apparicio, P., V. Petkevitch and M. Charron (2008): Segregation Analyzer: A C#.Net application for calculating residential segregation indices, Cybergeo: European Journal of Geography, 414, 1-27.
Proximity measures: Pxx
,
Pxy
, Poo
x <- segdata@data[ ,1:2] ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' SP(x, spatobj = segdata) SP(x, folder = foldername, shape = shapename, fdist = 'l', itype = 'between') SP(x, spatobj = segdata, diagval ='a', itype = 'one') SP(x, d = dist, fdist = 'e')
x <- segdata@data[ ,1:2] ar<-area(segdata) dist <- distance(segdata) diag(dist)<-sqrt(ar) * 0.6 foldername <- system.file('extdata', package = 'OasisR') shapename <- 'segdata' SP(x, spatobj = segdata) SP(x, folder = foldername, shape = shapename, fdist = 'l', itype = 'between') SP(x, spatobj = segdata, diagval ='a', itype = 'one') SP(x, d = dist, fdist = 'e')
The isolation index, xPx, is an exposure index that measures the probability that two members of a group share the same spatial unit. This index can be calculated using the approximate or the exact method (see Bell, 1954).
xPx(x, exact = FALSE)
xPx(x, exact = FALSE)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
exact |
a logical variable to specifiy the index version: exact = FALSE (by default) for the approximate version of the index, and exact = TRUE for the exact version |
A numeric vector containing the isolation index values for each group
Bell W. (1954) A probability model for the measurement of ecological segregation. Social Forces 32(4), pp. 357-364
Interaction indices:
xPy
, DPxy
x <- segdata@data[ ,7:8] xPx(x) xPx(x, exact = TRUE)
x <- segdata@data[ ,7:8] xPx(x) xPx(x, exact = TRUE)
The interaction index, xPy, is an exposure between groups index which measures the probability that a member of a group shares the same spatial unit with a member of another group. The index can be calculated with the approximate or exact method (see Bell, 1954).
xPy(x, exact = FALSE)
xPy(x, exact = FALSE)
x |
an object of class matrix (or which can be coerced to that class), where each column represents the distribution of a group within spatial units. The number of columns should be greater than 1 (at least 2 groups are required). You should not include a column with total population, because this will be interpreted as a group. |
exact |
a logical variable to specifiy the index version: exact = FALSE (by default) for the approximate version of the index, and exact = TRUE for the exact version |
A matrix containing the interaction index values for each pair of groups
Bell W. (1954) A probability model for the measurement of ecological segregation. Social Forces 32(4), pp. 357-364
Isolation indices:
xPx
, Eta2
, DPxx
Distance decay interaction index: DPxy
x <- segdata@data[ ,1:2] xPy(x)
x <- segdata@data[ ,1:2] xPy(x)