help for inequal7                                                (Ph. Van Kerm)

Measures of inequality (revised)

inequal7 varlist [weight] [if exp] [in range] [, format(%fmt) returnscalars]

aweights and fweights are allowed; see help weights.


inequal7 computes a series of inequality measures of the variables in varlist. It is a revised and upgraded version of inequal published by Edward Whitehouse in STB-23. inequal7 also supersedes the previously released inequal2.

Up to 5 variables can be specified in varlist.

The inequality measures computed are: the "relative mean deviation", the "coefficient of variation", the "standard deviation of logs", the"Gini index", the "Mehran index", the "Piesch index", the "Kakwani index", "Theil entropy index", the "mean log deviation" and the "generalised entropy measure" with sensitivity parameters -1 and 2 [see, e.g., Cowell [1995] for a definition of these measures].

Seven changes have been made compared to inequal: - Inclusion of the "generalised entropy measure" with sensitivity parameters -1 and 2; - The procedure accepts aweights; - The procedure computes inequality measures for up to 5 variables; - The procedure returns results in r() format (and in global macros); - Ranks are computed in a modified way with weighted data, so that results obtained with grouped data are consistent with individual data; - Output appearence conforms to Stata 7 standards; - Control over the display format is given to the user with a standard format(%fmt) option.


format(%fmt) specifies the format to be used to display the estimated inequality indices. The default is to use a %6.5f format.

returnscalars requests that estimated indices be returned in r() scalars (instead of r() locals).

Saved Results

For historical reasons, inequal7 returns results in r() locals and in global macros. However, to allow using inequal7 with the bootstrap or jkknife commands, results can be saved in r() scalars by specifying the returnscalars option.

[Important notice: When multiple variables are entered in varlist, returned results are the inequality measures of the last variable listed.]

r(rmd) and S_1 contain the "relative mean deviation" r(cov) and S_2 contain the "coefficient of variation" r(sdl) and S_3 contain the "standard deviation of logs" r(gini) and S_4 contain the "Gini coefficient"' r(mehran) and S_5 contain the "Mehran index" r(piesch) and S_6 contain the "Piesch index" r(kakwani) and S_7 contain the "Kakwani index" r(theil) and S_8 contain the "Theil index (or generalised entropy measure with sensitivity parameter 1)" r(mld) and S_9 contain the "Mean Log Deviation (or generalised entropy measure with sensitivity parameter 0)" r(ge_1) and S_10 contain the "Generalised entropy measure with sensitivity parameter -1" r(ge2) and S_11 contain the "Generalised entropy measure with sensitivity parameter 2"


inequal7 is an upgrade of inequal published in Stata Technical Bulletin 23. Edward Whitehouse, the original author, is therefore the key contributor to inequal7. Useful comments and testing by Stephen Jenkins are gratefully acknowledged. Thanks also to A. Peichl and A. Paulus for detailed bug reports.


Coulter Ph. (1989), Measuring Inequality -A Methodological Handbook-, Westview Press USA.

Cowell, F.A. (1995). Measuring Inequality (second edition). Prentice-Hall/Harvester-Wheatsheaf, Hemel Hempstead.

Whitehouse, E. (1994). sg30:Measures of inequality in Stata. Stata Technical Bulletin 23.


Philippe VAN KERM <philippe.vankerm@ceps.lu> CEPS/INSTEAD Differdange, G.-D. Luxembourg

Also see

Manual: [R] lorenz STB: sg30 (STB-23) On-line: help for inequal (if installed), ineqdeco (if installed), ineqerr (if installed)