spatial_gini: Spatial Gini Index

View source: R/global-gini.R View source: R/global-gini.R

spatial_giniR Documentation

Spatial Gini Index

Description

Calculates the spatial Gini index for a given numeric vector and neighbor list. Based on the formula provided Rey and Smith (2013).

Usage

spatial_gini(x, nb)

Arguments

x

a numeric vector without missing values

nb

a neighbor list, for example created with st_contiguity()

Details

The Gini index is a global measure of inequality based on the Lorenz curve. It ranges between 0 and 1 where 0 is perfect equality and 1 is perfect inequality.

The spatial Gini index decomposes the Gini coefficient based on spatial neighbors.

Value

A data frame with columns:

  • G: the Gini index

  • NBG: the neighbor composition of the Gini coefficient

  • NG: the non-neighbor composition of the Gini coefficient

  • SG: the Spatial Gini which is equal to NG * \frac{1}{G}

References

\Sexpr[results=rd]{tools:::Rd_expr_doi("http://dx.doi.org/10.1007/s12076-012-0086-z")}

Examples

nb <- st_contiguity(guerry)
x <- guerry$wealth
spatial_gini(x, nb)


JosiahParry/sfdep documentation built on Sept. 7, 2024, 6:15 a.m.