R/gini.2002.R

Defines functions gini.2002

Documented in gini.2002

# x: population of each region
# y: resource of each region
gini.2002=function(x,y){
  index=order(y/x)
  x=x[index]
  y=y[index]
  W=y/sum(y)
  P=x/sum(x)
  Q=cumsum(y)/sum(y)
  G=1-sum(P*(2*Q-W))
  return(G)
}

Try the Gini package in your browser

Any scripts or data that you put into this service are public.

Gini documentation built on Sept. 13, 2021, 5:06 p.m.