Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gini coefficient for population level data

    Hello Everyone,

    I have a population-level dataset that breaks down the proportion of income share by various sociodemographic variables (age, gender, and ethnicity) and I would like to calculate the GINI coefficient to compare pre- and post-COVID19 pandemic to check whether the inequity gap has widened.
    I know Stata doesn't have its own command to calculate the Gini coefficient and I looked into the various users' commands, but none seem to match my dataset specifications: the command glcurve can plot the Lorenz curves, but does not provide the Gini coefficient, and the command lorenz can only be used with individual-level data, etc...

    Any advice on how I could get the Gini coefficient for population-level data?
    I'll take any help/suggestions!

    Thank you,
    Flav
    Last edited by Flavien Coukan; 05 Mar 2023, 08:25.

  • #2
    You can look into rifvar (Stata Journal) and dstat (ssc)

    Code:
    . sysuse nlsw88, clear
    (NLSW, 1988 extract)
    
    . 
    . 
    . dstat (gini) wage
    
    Summary statistics                Number of obs   =      2,246
    
    --------------------------------------------------------------
            wage | Coefficient  Std. err.     [95% conf. interval]
    -------------+------------------------------------------------
            gini |   .3325258    .006698      .3193909    .3456607
    --------------------------------------------------------------
    
    . di r(table)[1,1]
    .33252581
    
    . 
    . egen Gini = rifvar(wage), gini
    
    . sum Gini
    
        Variable |        Obs        Mean    Std. dev.       Min        Max
    -------------+---------------------------------------------------------
            Gini |      2,246    .3325258    .3174303   .1413221   2.501671

    Comment


    • #3
      Thank you Justin, however your suggestion only seems to apply to individual-level data and the data I am working with is aggregated at the population level, unless I'm mistaken?

      Comment


      • #4
        Can you describe what kind of data you have
        per a snapshot
        if you have just aggregates, look for the paper “a tale of two Gini’s”
        Also this paper https://www.mdpi.com/2227-7390/9/20/2551

        Comment

        Working...
        X