Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: 95% cofidence intervals of the Gini coefficient


From   "Stephen P. Jenkins" <[email protected]>
To   [email protected]
Subject   st: 95% cofidence intervals of the Gini coefficient
Date   Sun, 20 May 2007 13:43:12 +0100 (BST)

> Date: Sat, 19 May 2007 21:49:57 +0900 (JST)
> From: <[email protected]>
> Subject: st: 95% cofidence intervals of the Gini coefficient
>
> Dear Friends
>
>  I am a user of STATA9.
>
> I calculate the Gini coefficient using -ineqdeco- and -inequdec0-.I understood the
> difference between -ineqdeco- and inequdec0-.
>  My question is how to compute 95% confidence interval from the data set including
> values zero in weighted data. I have already used -ineqerr-.
> Point estimate of the Gini coefficient obtained from -inequdec- did not range from
> lower limit to upper limit calculated  -ineqerr-!!!!
> How can I manage it?
>
>  Thank you in advance
>
> Koichi


You must show us _exactly_ what you typed, and the output, for us to assess what
might be happening.  Moreover, it is better to reproduce the apparent problem using
a data set all have access to (e.g. those available via -sysuse-). See an example
below which shows that the same point estimate is derived in comparable cases.

-ineqdeco- produces point estimates of the Gini, where the variable of interest is
assumed to have positive values (zero and negative values are not used), and you
can derive bootstrapped SEs. -ineqdec0- will also estimate the Gini, but allowing
variables with values of zero.  The latest versions of these programs are available
from SSC, and illustrations of their use is shown in the help files.
See also -svylorenz- (on SSC) which allows zero values, and derives SEs by
linerarization methods

I have not used -ineqerr- (having preferred my own programs!). I note that it is a
version 5 program, and the others cited are version 8.2 or higher. It has 2 options
for handling weights, and this affects how SEs are computed. It does not use obs
with zero values.

Note also that derivation of bootstrapped SEs _using weighted data_ is a topic area
that has not received a lot of attention, and there is no consensus yet about how
to proceed.


. sysuse auto, clear
(1978 Automobile Data)

. replace price = 0 in 1/2
(2 real changes made)

. version 8: svyset [pw=mpg], psu(foreign)
pweight is mpg
psu is foreign

. svylorenz price

Warning: price has 2 values = 0. Used in calculations


Quantile group shares, cumulative shares (Lorenz ordinates),
generalized Lorenz ordinates, and Gini

Number of strata =          1               Number of obs    =           74
Number of PSUs   =          2               Population size  =      1576.00
                                            Design df        =            1

---------------------------------------------------------------------------
  Group  |             Linearized
  share  |   Estimate   Std. Err.     z      P>|z|     [95% Conf. Interval]
---------+-----------------------------------------------------------------
    1    |   0.055638   0.109694    0.507    0.612      -.159358    .270634
    2    |   0.065121   0.021002    3.101    0.002      .0239579    .106284
    3    |   0.076012   0.021170    3.591    0.000      .0345194    .117505
    4    |   0.079359   0.022093    3.592    0.000      .0360576     .12266
    5    |   0.075684   0.022154    3.416    0.001      .0322643    .119104
    6    |   0.089191   0.020442    4.363    0.000       .049125    .129257
    7    |   0.105285   0.020731    5.079    0.000      .0646534    .145917
    8    |   0.105512   0.026994    3.909    0.000      .0526037     .15842
    9    |   0.135774   0.035472    3.828    0.000        .06625    .205299
    10   |   0.212423   0.080365    2.643    0.008      .0549114    .369935
---------+-----------------------------------------------------------------
  Cumul. |
  share  |
    1    |   0.055638   0.109694    0.507    0.612      -.159358    .270634
    2    |   0.120759   0.088692    1.362    0.173     -.0530736    .294591
    3    |   0.196771   0.067521    2.914    0.004      .0644317    .329111
    4    |   0.276130   0.045429    6.078    0.000       .187092    .365169
    5    |   0.351815   0.023275   15.115    0.000       .306196    .397433
    6    |   0.441005   0.002833  155.669    0.000       .435453    .446558
    7    |   0.546291   0.017898   30.523    0.000       .511211     .58137
    8    |   0.651803   0.044892   14.519    0.000       .563815     .73979
    9    |   0.787577   0.080365    9.800    0.000       .630065    .945089
    10   |   1.000000
---------+-----------------------------------------------------------------
  Gen.   |
  Lorenz |
    1    |    316.381     91.057    3.475    0.001       137.913    494.849
    2    |    686.687     85.824    8.001    0.000       518.475    854.899
    3    |   1118.925     98.733   11.333    0.000       925.412   1312.438
    4    |   1570.193    112.263   13.987    0.000      1350.161   1790.225
    5    |   2000.567    119.006   16.811    0.000      1767.319   2233.814
    6    |   2507.744    159.164   15.756    0.000      2195.787   2819.700
    7    |   3106.440    225.903   13.751    0.000      2663.679   3549.202
    8    |   3706.426    257.422   14.398    0.000      3201.888   4210.964
    9    |   4478.496    293.800   15.243    0.000      3902.660   5054.333
    10   |   5686.424    191.304   29.725    0.000      5311.475   6061.374
---------+-----------------------------------------------------------------
  Gini   |  0.2360649  .02180983   10.824    0.000      .1933185   .2788114
---------------------------------------------------------------------------

. ineqdeco price [aw=mpg]

Warning: price has 2 values = 0. Not used in calculations

Percentile ratios

----------------------------------------------------------
  All obs |    p90/p10     p90/p50     p10/p50     p75/p25
----------+-----------------------------------------------
          |      2.563       2.057       0.803       1.490
----------------------------------------------------------

Generalized Entropy indices GE(a), where a = income difference
 sensitivity parameter, and Gini coefficient

----------------------------------------------------------------------
  All obs |     GE(-1)       GE(0)       GE(1)       GE(2)        Gini
----------+-----------------------------------------------------------
          |    0.07149     0.07662     0.08702     0.10550     0.21668
----------------------------------------------------------------------

Atkinson indices, A(e), where e > 0 is the inequality aversion parameter

----------------------------------------------
  All obs |     A(0.5)        A(1)        A(2)
----------+-----------------------------------
          |    0.04010     0.07376     0.12509
----------------------------------------------

. ineqdec0 price [aw=mpg]

Warning: price has 2 values = 0. Used in calculations

Percentile ratios

----------------------------------------------------------
  All obs |    p90/p10     p90/p50     p10/p50     p75/p25
----------+-----------------------------------------------
          |      2.563       2.061       0.804       1.493
----------------------------------------------------------

Generalized Entropy index GE(2), and Gini coefficient

----------------------------------
  All obs |      GE(2)        Gini
----------+-----------------------
          |    0.12086     0.23606
----------------------------------

. ineqerr price, weight(mpg) psu(foreign)
option weight() not allowed
r(198);

. ineqerr price [aweight = mpg], psu(foreign) reps(50)

price ------------------------------------------------------------------- Price
2 values = 0. Not used in calculations.
(obs=72)

Bootstrap statistics

Variable |   Reps   Observed       Bias   Std. Err.   [95% Conf. Interval]
---------+-------------------------------------------------------------------
    Gini |     50   .2166808  -.0055078   .0251136    .1662132  .2671483  (N)
         |                                            .1616089  .2496886  (P)
         |                                            .1616089  .2771308 (BC)
---------+-------------------------------------------------------------------
   Theil |     50   .0870174  -.0010619   .0200851    .0466549  .1273799  (N)
         |                                             .048003  .1188811  (P)
         |                                             .048003  .1188811 (BC)
---------+-------------------------------------------------------------------
 Varlogs |     50     .13249  -.0026397   .0284316    .0753545  .1896255  (N)
         |                                            .0774393  .1760419  (P)
         |                                            .0774393  .2187282 (BC)
-----------------------------------------------------------------------------
                              N = normal, P = percentile, BC = bias-corrected



Stephen (author of -ineqdeco-, -ineqdec0-, -svylorenz-)
-----------------------------------------
Professor Stephen P. Jenkins <[email protected]>
Institute for Social and Economic Research
University of Essex, Colchester CO4 3SQ, U.K.
Tel: +44 1206 873374.  Fax: +44 1206 873151.
http://www.iser.essex.ac.uk
Survival Analysis using Stata:
http://www.iser.essex.ac.uk/teaching/degree/stephenj/ec968/
Downloadable papers and software: http://ideas.repec.org/e/pje7.html

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index