R/gini.mean.diff.R

"gini.mean.diff" <-
function(x) {
  x <- sort(x[! is.na(x)])
  n <- length(x)
  gini <- (2/(n*(n-1)))*sum(x*seq((1-n),(n-1), by=2))
  z <- list(gini=gini, L2=gini/2,
            source="gini.mean.diff")
  return(z)
}

Try the lmomco package in your browser

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

lmomco documentation built on Aug. 30, 2023, 5:10 p.m.