Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9254125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:23:17+00:00 2026-06-18T11:23:17+00:00

I need to calculate the Gini coefficient from disposable personal income data at LIS.

  • 0

I need to calculate the Gini coefficient from disposable personal income data at LIS. According to a LIS training document, the Stata code to do this is:

    di "** INCOME DISTRIBUTION II – Exercise 13 **"
    program define bottop
    qui sum ey [w=hweight*d4]
    replace ey = .01*r(mean) if ey<.01*r(mean)
    qui sum dpi [w=hweight*d4], de
    replace ey = (10*r(p50)/(d4^.5)) if dpi>10*r(p50)
    end
    foreach file in $us00h $fi00h {
    display "`file'"
    use hweight d4 dpi if (!mi(dpi) & !(dpi==0)) using "`file'", clear
    gen ey=dpi/(d4^0.5)
    bottop
    ineqdeco ey [w=hweight*d4]
    }

I have simply copied and pasted this code from the training document. The snippets

    qui sum ey [w=hweight*d4]
    replace ey=0.01*r(mean) if ey<0.01*r(mean)

and

    qui sum dpi [w=hweight*d4], de
    replace ey=(10*r(p50)/(d4^0.5)) if dpi>10*r(p50)

are bottom and top coding, respectively.

When I tried to run this code, the variable hweight was not found. Does anyone know what the new name of hweight is at LIS? Or can anyone suggest how I might otherwise overcome this impasse?

I’m familiar with stata, but the sophistication of this code is beyond my ken.

Much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:23:18+00:00Added an answer on June 18, 2026 at 11:23 am

    This is more of a second-best solution. However, the census of population provides income by brackets. If you are willing to do that, you can get the counts for every bracket. Have a top-coded bracket for the last one. Use the median income value within each bracket. Then you can directly apply the formula for the Gini coefficient. It is a second best because it is an approximation for the individaul-level data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to calculate the within and between run variances from some data as
I need to calculate Tanimoto Coefficient. I don't know what's wrong in my code.
I need to calculate the quantity of nights (stay at a hotel) from the
Need to calculate optimum ulimit and fs.file-max values according to my own server needs.
I need to calculate Gps Location on the move and on deviation from certain
I need to calculate a median on a set of data, so I created
i need calculate normal of 6 faces from cube. The cube is moved with
I need to calculate and add to a data frame multiple new columns based
I need to calculate a percentage from a cumulative value. The percent rate to
I need to calculate if someone is over 18 from their date of birth

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.