spGini: Spatial Gini coefficient

Description Usage Arguments Value Author(s) References Examples

View source: R/spGini.R

Description

This is the implementation of the spatial decomposition of the Gini coefficient introduced by Rey and Smith (2013). The function calculates the global Gini and the two components of the spatial Gini: the inequality among nearest (geographically) neighbours and the inequality of non-neighbours. Three weighted schemes are currently supported: binary, bi-square and row standardised bi-square.

Usage

1
spGini(Coords, Bandwidth, x, WType = 'Binary')

Arguments

Coords

a numeric matrix or vector or data frame of two columns giving the X,Y coordinates of the observations (data points or geometric / population weighted centroids)

Bandwidth

a positive integer that defines the number of nearest neighbours for the calculation of the weights

x

a numeric vector of a variable

WType

a string giving the weighting scheme used to compute the weights matrix. Options are: "Binary", "Bi-square", "RSBi-square". Default is "Binary".

Binary: weight = 1 for distances less than or equal to the distance of the furthest neighbour (H), 0 otherwise;

Bi-square: weight = (1-(ndist/H)^2)^2 for distances less than or equal to H, 0 otherwise;

RSBi-square: weight = Bi-square weights / sum (Bi-square weights) for each row in the weights matrix

Value

Returns a list of five values Gini, gwGini, nsGini, gwGini.frac, nsGini.frac

Gini

Global Gini

gwGini

First component of the spatial Gini: the inequality among nearest (geographically) neighbours

nsGini

Second component of the spatial Gini: the inequality among non-neighbours

gwGini.frac

The fraction of the first component of the spatial Gini

nsGini.frac

The fraction of the second component of the spatial Gini

Author(s)

Stamatis Kalogirou <stamatis@lctools.science>

References

Rey, S.J., Smith, R. J. (2013) A spatial decomposition of the Gini coefficient, Letters in Spatial and Resource Sciences, 6 (2), pp. 55-70.

Kalogirou, S. (2015) Spatial Analysis: Methodology and Applications with R. [ebook] Athens: Hellenic Academic Libraries Link. ISBN: 978-960-603-285-1 (in Greek). https://repository.kallipos.gr/handle/11419/5029?locale=en

Examples

1
2
3
4
5
6
data(GR.Municipalities)
Coords1<-cbind(GR.Municipalities@data$X, GR.Municipalities@data$Y)
Bandwidth1<-12
x1<-GR.Municipalities@data$Income01
WType1<-'Binary'
spGini(Coords1,Bandwidth1,x1,WType1)

Example output

Loading required package: reshape
Loading required package: weights
Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'Hmisc'

The following objects are masked from 'package:base':

    format.pval, units

Loading required package: gdata
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to locate valid perl interpreter
gdata: 
gdata: read.xls() will be unable to read Excel XLS and XLSX files
gdata: unless the 'perl=' argument is used to specify the location of a
gdata: valid perl intrpreter.
gdata: 
gdata: (To avoid display of this message in the future, please ensure
gdata: perl is installed and available on the executable search path.)
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.

gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.

gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.

Attaching package: 'gdata'

The following object is masked from 'package:stats':

    nobs

The following object is masked from 'package:utils':

    object.size

The following object is masked from 'package:base':

    startsWith

Loading required package: mice

Attaching package: 'mice'

The following objects are masked from 'package:base':

    cbind, rbind

Loading required package: pscl
Classes and Methods for R developed in the
Political Science Computational Laboratory
Department of Political Science
Stanford University
Simon Jackman
hurdle and zeroinfl functions by Achim Zeileis
Loading required package: MASS
       Gini      gwGini      nsGini gwGini.frac nsGini.frac 
0.145501498 0.003420536 0.142080961 0.023508599 0.976491401 

lctools documentation built on April 14, 2020, 6:04 p.m.