Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

I have a time series of data with N=14 counts at each time point, and I want to calculate the Gini coefficient and a standard error for this estimate at each time point.

Since I have only N=14 counts at each time point I proceeded by calculating the jackknife variance, i.e. $\operatorname{var}(G) = \frac{n-1}{n} \times \sum_{k=1}^n (G(n,k)-\bar{G}(n))^2$ from equation 7 of Tomson Ogwang 'A convenient method of computing the Gini index and its' standard error'. Where $G(n,k)$ is the Gini coefficient of the N values without element $k$ and $\bar{G}(x)$ is the mean of the $G(n,k)$.

Direct naive implementation of the above formula for Variance.

calc.Gini.variance <- function(x) {
  N <- length(x)
  # using jacknifing as suggested by Tomson Ogwang - equation 7
  # in the Oxford Bulletin of Economics and Statistics, 62, 1 (2000)
  # ((n-1)/n) \times \sum_{k=1}^n (G(n,k)-\bar{G}(n))^2
  gini.bar <- Gini(x)

  gini.tmp <- vector(mode='numeric', length=N)
  for (k in 1:N) {
    gini.tmp[k] <- Gini(x[-k])
  }
  gini.bar <- mean(gini.tmp)
  sum((gini.tmp-gini.bar)^2)*(N-1)/N
 }
 calc.Gini.variance(c(1,2,2,3,4,99)) 
 # [1] 0.1696173
 Gini(c(1,2,2,3,4,99))
 # [1] 0.7462462

Is this a reasonable approach for a small N? Any other suggestions?

share|improve this question
I'd have added 'Gini' as a tag but don't have the rep. – Sean Jan 28 '12 at 11:17
Maybe you can add the actual calculations you're using for both the sample estimate and the standard error since many people may not have access to the paper at the link provided. – cardinal Jan 28 '12 at 16:56

1 Answer

up vote 3 down vote accepted

One problem will be that with this small sample size and a complex statistic (gini coefficient) the probability distribution of your statistic will certainly not be approximately normal, so the "standard error" may be misleading if you intend to use it to create confidence intervals or hypothesis testing relying on normality.

I would have thought a percentile bootstrap would be a better method, and simpler to implement. For example:

> library(reldist) # just for the gini() function
> library(boot) # for the boot() function
> x <- c(1,2,2,3,4,99)
> gini(x)
[1] 0.7462462 # check get same result as in your question
> y <- boot(x, gini, 500)
> quantile(y$t, probs=c(0.025, 0.975))
     2.5%     97.5% 
0.6353158 0.7717868 
> plot(density(y$t))

I haven't attached the plot generated by the end but it shows that the confidence interval is very assymetric, so using a method like +/- 1.96*se for a confidence interval will be misleading. I'm not a fan of jackknife methods for confidence intervals mainly for this reason; jackknife was invented as a bias reduction technique for point estimates, whereas confidence intervals are intrinsic to the whole idea of the bootstrap.

share|improve this answer
Thank you Peter! – Sean Jan 31 '12 at 8:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.