for an income decomposition procedure I use the -kdensity- function to obtain probability values across the income spectrum. After linear transformations of several income subgroups I would like to obtain inequality measures like the Gini and p90/p50 for factual and counterfactual income subgroups. I know about the -ineqdeco- command to compute such indices from observational data, however I don’t know how I could obtain these measures based on the calculated density values (my variable 'f_dens') across my income spectrum (which is my variable 'grid').
Here is the challenge: let's assume for this test case that my observational data come from a normal function with a mean 50000 and a sd of 10000. If I computed the Gini with the ineqdeco I would get a value of .112. But how could I obtain the same value simply based on the estimated density values (f_dens) and my income spectrum (grid) ?
Code:
gen range grid 0 150000 200
gen f_val = rnormal(50000,10000)
kdensity f_val, at(grid) gen(f_dens)
Thank you!
Andreas
0 Response to obtaining distribution measures from estimated densities
Post a Comment