R/gini.1994.R

Defines functions gini.1994

Documented in gini.1994

# x: population of each region
# y: resource of each region
gini.1994=function(x,y){
  index=order(y/x)
  A=x[index]
  B=y[index]
  E=cumsum(B)
  S=sum(0.5*A*B+A*c(0,E[1:(length(E)-1)]))/(sum(A)*sum(B))
  G=2*(0.5-S)
  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.