*! version 1.0.3 March 2020

help for ineqordStephen P. Jenkins (March 2023)

Indices of inequality and polarization for ordinal data

Syntax

ineqord
varname
[weight]
[if] [in]
[,
options]

Main
alpha(#) calculate additional Cowell-Flachaire index with parameter #

nlevels(#) specify total number of levels of response varname: see below

minlevel(#) specify minimum level of response varname: see below

ustatusvar(string) save Cowell-Flachaire upward-looking status variable after calculation

dstatusvar(string) save Cowell-Flachaire downward-looking status variable after calculation

catvals(string) save distinct values of the response in a new variable

catprops(string) save sample category proportions in a new variable

catcprops(string) save sample cumulative proportions in a new variable

catsprops(string) save sample cumulative survivor proportions in a new variable

gldvar(string) save Generalized Lorenz ordinates for Cowell-Flachaire downward-looking status in a new variable

gluvar(string) save Generalized Lorenz ordinates for Cowell-Flachaire upward-looking status in a new variable

hplus(string) save H+ ordinates in a new variable

hminus(string) save H- ordinates in a new variable

by and statsby are allowed; see prefix.

aweights, fweights, pweights, and iweights are allowed.
See weight.

Description

ineqord calculates indices of inequality and polarization for ordinal data
recorded in varname: the Allison-Foster index, the normalized Average Jump index,
multiple Apouey indices (parameters 0.5, 1, and 2), multiple Abul Naga-Yalcin
indices (parameters (a,b) = (1,1), (2,1), (1,2), (4,1) and (1,4)),
multiple Cowell-Flachaire indices (for peer-inclusive downward and upward-looking status;
parameter alpha = 0, 0.25, 0.5, 0.75 and, optionally, another alpha value
between 0 and 1), the Jenkins index, and also the standard deviation. Optionally,
ineqord also derives estimates of cumulative distribution functions,
survivor functions, Generalized Lorenz curves for 'status', and H-plus and H-minus
curves, and saves them in new variables. These can be used to describe
ordinal data distributions and to undertake dominance checks of differences
between distributions.

Summarizing and comparing distributions of individuals' subjective well-being (SWB)
is the principal application intended for ineqord, where SWB refers to e.g.
overall life satisfaction (or satisfaction with a particular life domain such as work or
health), health status, or happiness. For example, regarding life satisfaction,
respondents may be presented with a linear integer scale running from 0 to 10
and asked to respond to the question "overall, how satisfied are you with your
life nowadays where 0 is 'not at all satisfied' and 10 is 'completely satisfied'?"
Similar scales are used for other SWB measures. Some Likert-like SWB scales employ a
mixture of negative and non-negative integers to label the scale levels. It is
assumed that respondents who report the same score have the same well-being.

ineqord assumes the user has respondent-level data: each response on
varname refers to the ordinal well-being score for a respondent. If the
user has only grouped data on the distribution of the well-being variable,
the user needs first to construct an individual-level dataset using this
information. See the Examples section for illustrations.

The indices calculated by ineqord summarize dispersion in the distribution
of responses across the K levels of varname, where K >= 3. The
levels have numerical labels c_1, c_2, c_3, ..., c_K, where
-oo < c_1 < c_2 < c_3 < ... < c_K < oo. The `linear
integer' scale cited below is the one with c_k = k, for each k =
1, 2, 3, ..., K. The empirical distribution of responses is described by the
proportion of the N individuals who report the kth level, f_k,
for each k. The cumulative distribution function is described
by the proportion of individuals reporting the kth level or lower,
F_k = Sum(from 1 to k) f_k, for each k. The survivor
function is described by the proportion of individuals reporting the kth
level or higher, S_k = Sum(from k to K) f_k, for each k.

A commonly-used measure of inequality of such ordinal data, especially life
satisfaction and happiness data, is the standard deviation. Use of this measure is
inappropriate because it assumes that varname is measured on a ratio scale.
(Kalmijn and Veenhoven (2005) acknowledge this issue but claim that the
standard deviation is an appropriate measure nonetheless.)

Economists specialising in inequality measurement have long been critical of the
application to ordinal data of the standard deviation and other inequality indices
typically applied to variables measured on a ratio scale. These indices use the
mean as the reference point for assessing spread but with ordinal data, the
value of the mean is contingent on the scale used. For critiques, see e.g.
Allison and Foster (2004), Cowell and Flachaire (2017), and Dutta and Foster
(2013). These authors and others propose inequality measures that respect the
ordinal nature of the data. In one tradition, indices characterize greater
inequality as greater spread about the median. The other tradition characterizes
greater inequality as greater spread away from a maximum value.

The Allison-Foster index is the difference between the mean score for
respondents with scores above the median minus the mean score for respondents
with scores below the median. This polarization index was first proposed by
Allison and Foster (2004). Dutta and Foster (2013) provide more extensive
discussion of it, and the formulae used by ineqord are based on their
equations 1 and 2 (p. 398).

The two-parameter indices proposed by Abdul Naga and Yalcin (2008,
ANY(a,b), a,b >= 1 are a form of weighted difference
between the percentage of people in the lower half of the distribution and
the percentage in the upper half of the distribution. The parameters tune the
weights given to the two halves. ANY(1,1) weights the two halves equally.
Roughly speaking, when a > b, ANY(a,b) gives greater
weight to the top half of the distribution. According to Abul Naga and Yalcin
(2008: 1621), "For a given value of b, ..., as a --> oo, the
inequality index abstracts from the dispersion below the median". On the
other hand, and again roughly speaking, when b > a, ANY(a,b)
gives greater weight to the bottom half of the distribution. For a given value
of a, choosing larger and larger values of b places less weight on
the distribution in categories above the median. In the limiting case when b
--> oo, only below-median categories are relevant. Thus, e.g., the indices
ANY(1,1), ANY(1,2), and ANY(1,4) respectively give increasingly
greater weight to the lower half of the distribution when assessing overall
polarization.

Apouey's (2007) P2(e) indices each aggregate the `distances' between
F_k and 0.5 (the value of F_k at the median) across the levels
of varname. P2(0.5) uses the square root of the absolute differences
to summarize 'distance' and P2(1) uses a 'city block' (linear) distance
function. P2(2) uses a Euclidean distance metric and is the same as
the the '1 - l-squared' index of Blair and Lacy (2000).
(The Blair-Lacy index may also be calculated using ordvar on SSC.)
In general, the value of parameter e determines how shifts in
concentration within the group below the median - or the group
above the median - are assumed to affect overall polarization.

The Average Jump index is the average across respondents of the absolute difference
between each observed value of varname and the median value, normalized
by the maximum value for the index. For a linear integer scale, the Average Jump
index equals the Allison-Foster index divided by the total number of levels of
varname minus one (Allison and Foster, 2004, p. 514). In this case
(as with the life satisfaction scale cited at the beginning), the index summarizes
the (normalized) average number of category 'jumps' required to change from the
observed level to the median level. For a linear integer scale, the Average Jump index
is the same as the ANY(1,1) index and the P2(1) index.

Cowell and Flachaire (2017) build inequality measures from axiomatic first principles,
providing two families of one-parameter indices based on downward-looking and
upward-looking measures of individual 'status', respectively. ineqord
uses the 'peer-inclusive' (rather than 'peer-exclusive') definitions
of these, reflecting the focus of Cowell and Flachaire (2017). For an
individual reporting a response corresponding to the kth level of the
scale, peer-inclusive downward-looking status is given by F_k and
peer-inclusive upward-looking status is given by S_k. The inequality
indices aggregate 'distances' between each individual's status and the maximum
possible status value.

Members of the two Cowell-Flachaire inequality index families I(alpha),
are distinguished by parameter alpha which encapsulates the sensitivity of
overall inequality to the dispersion of individual status in different ranges
of the status distribution. The lower that alpha is, the more sensitive
the overall index is to differences in status at the bottom of the status
distribution rather than at the top. If the distribution of responses on
varname is symmetric across the levels, F_k = S_k and each
downward-looking Cowell-Flachaire index has the same value as its upward-looking
counterpart.

Jenkins's (2019b) Jd index is defined for Cowell and Flachaire's
peer-inclusive downward-looking status measure and his Ju index
for their peer-inclusive upward-looking status measure. Each index is
equal to the area between the Generalized Lorenz curve for the relevant
status distribution and the Generalized Lorenz curve for the distribution with
no status inequality (in which case the Generalized Lorenz Curve is a
straight line between the origin and point (1,1)), divided by the total area
beneath the perfect equality curve (= 0.5). Equivalently, each index is equal
to one minus twice the area beneath Generalized Lorenz curve for status.
The Generalized Lorenz curve for status, GL(p), plots cumulative status
per capita against cumulative population share, 0 ≤ p ≤ 1, of individuals
ranked in ascending order of status. GL(0) = 0 and GL(1) is the arithmetic
mean of status. See Jenkins (2019b) for details.

All of the indices calculated by ineqord equal their minimum value, zero,
if all respondents report the same value for varname. The Allison-Foster,
Average Jump, Apouey, and Abul Naga and Yalcin indices each
summarize polarization of responses relative to the median. These indices reach
their maximum value when half the responses on varname refer to the minimum
value of the scale and half the responses refer to the maximum value, i.e. the
distribution of responses is totally polarized. In this case, the maximum value
of the indices equals one (except for the Allison-Foster index, for which the maximum
value depends on the number of categories). Cowell-Flachaire I(alpha)
and J indices need not reach a maximum value with this distribution of
responses: this is because the indices summarize inequality as spread
rather than as polarization. For example, I(alpha)
and J indices record greater inequality for a uniform distribution
than for a totally polarized distribution (Jenkins 2019b).

I(alpha) and J indices are invariant to order-preserving
transformations of the ordinal scale variable (i.e. scale independent).
The Allison-Foster index is not scale independent and hence Dutta and
Foster (2013), in their empirical applications, provide estimates based on
linear, convex, and concave scales. Abul Naga-Yalcin and Apouey indices
are scale independent (but also see the remarks about scale levels below).

For correct calculation of the Abul Naga-Yalcin, Average Jump, Apouey,
and Jenkins indices, ineqord must know the total number of
possible levels of the ordinal response variable. This number may be greater than
the maximum observed in the data, e.g. if there are no responses on
some scale values or if there is total polarization. By default, ineqord
assumes that the total number of possible levels of the ordinal response
is the observed number of levels containing responses. If this assumption
is incorrect, it is the user's responsibility to specify the maximum number
of levels of response using the nlevels option.
See also the discussion of scale dependence below.

The Apouey indices refer to the case in which the ordered response
categories are labelled with positive integers (1 for the lowest level, 2 for
the second lowest, etc.), which is a linear integer scale. For correct calculation
of these indices, it is the user's responsibility to check that the scale
underlying varname is appropriate. Optionally, ineqord relabels
the observed responses to calculate the Apouey indices using
a linear transformation: response_new = response - minlevel + 1, where
minlevel is the value specified by the minlevel option. For example,
using the option, the life satisfaction scale cited above (0, 1, ..., 10) is
converted to (1, 2, ..., 11) by setting minlevel = 0. Scale (-1, 0, 1)
would be converted to (1, 2, 3) by setting minlevel = -1. Be aware that
if the response scale values were instead, (2, 4, 6), say, and the user sets
minlevel = 2, ineqord's calculation would be based on transformed
responses (1, 3, 5), not (1, 2, 3), and correct calculation of the Apouey
(and J) indices would also require setting the maximum number of levels to
5 using the nlevels option. Calculation of the indices would assume that
scale values 2 and 4 are possible (and this is relevant to the assessment of
how polarized varname is), but there are no responses observed for them.
On related issues, see the discussion of the 'mergers principle' by Cowell
and Flachaire (2017).

ineqord also provides users with the information required to carry out
dominance checks. Dominance results show that if an appropriately defined graph
for one distribution lies everywhere on or above the corresponding graph for
another distribution, this is equivalent to a unanimous ranking of the two
distribution by all measures satisfying a particular set of properties.

Allison and Foster (2004) provide results for 'F-dominance' and 'S-dominance'.
The former refers to comparisons of CDFs and rankings by average well-being levels:
if the CDF for distribution A lies everywhere on or above the CDF below that for
distribution B, then A has higher average well-being than B,
regardless of scale. S-dominance refers to comparisons of S-curves, which are
derived from CDFs and so the criterion can also be expressed in terms of these.
If A and B have the same median, and the CDF for A lies above that for
B at scale values below the median but above that for B at scale values at the
median and above, all polarization indices respecting the property that greater
spread about the median corresponds to greater polarization will show A as
having greater polarization than B. S-dominance can only arise if the pair of
distributions have a common median and if there is no F-dominance.

Jenkins (2019b) shows that, for each of the two Cowell-Flachaire definitions
of status, if the Generalized Lorenz curve for status distribution A
lies nowhere above the Generalized Lorenz curve for status distribution B,
all Cowell-Flachaire I(alpha) indices and the J index will
show A as having more inequality than B. The Generalized Lorenz
Curve comparisons can be applied if the distributions have different medians.

For Gravel, Magdalou, and Moyes (2020), inequality of an ordinal variable
increases if there is a shift in density mass away from a specific level (one
person moving up a level and one moving down). This is the concept of a
disequalizing 'Hammond transfer'. The authors define an 'H+' curve
and an 'H-' curve and prove a dual dominance result: distribution
A being more equal than distribution B is equivalent to finding the
H+ curve for A lying nowhere above the H+ curve
for B and also the H- curve for A lying nowhere above
the H- curve for B. In addition, F-dominance implies
H+ dominance. The dual dominance check can be applied if the
distributions have different medians.

Bootstrapped standard errors for the indices can be derived using bootstrap
or e.g. rhsbsample. Analytical formulae exist for some of the indices
but not all of them (see the References below), and the formulae provided
do not account for sample design features such as weights, clustering, or stratification.

For an extensive set of examples using ineqord, see Jenkins (2019a, 2019b).

Options

Main

alpha(#) Use this to calculate an additional Cowell-Flachaire index
with parameter value alpha. The value must be between 0 and 1.

nlevels(#) Use this to specify the total number of possible levels of
the ordinal response variable. Required for correct calculation of the
Blair-Lacy and Apouey indices if the observed number of levels is less than the
maximum possible.

minlevel(#) Use this to specify the minimum level of the ordinal response
variable. Required for correct calculation of the Blair-Lacy and Apouey indices
if the observed minimum is not equal to 1.

ustatusvar(string) Use this to save the Cowell-Flachaire `upward-looking'
status variable after calculation.

dstatusvar(string) Use this to save the Cowell-Flachaire `downward-looking'
status variable after calculation.

catvals(string) Use this to save the distinct values of the response variable after calculation.

catprops(string) Use this to save the sample proportions after calculation.

catcprops(string) Use this to save the sample cumulative proportions after calculation.

catsprops(string) Use this to save the sample cumulative survivor proportions after calculation.

gldvar(string) Use this to save the Generalized Lorenz ordinates of the Cowell-Flachaire `downward-looking'
status variable after calculation.

gluvar(string) Use this to save the Generalized Lorenz ordinates of the Cowell-Flachaire `upward-looking'
status variable after calculation.

hplus(string) Use this to save H+ ordinates in a new variable after calculation.

hminus(string) Use this to save H- ordinates in a new variable after calculation.

Examples

Dutta and Foster (2013, p. 514)

set obs 5

ge X = 0

replace X = -1 if _n == 1

replace X = 1 if _n == 5

ineqord X

ineqord X, minlevel(-1) // note effect on J, Blair-Lacy, and Ahouey indices

Abul Naga and Yalcin (2008, Tables 2, 4); case with no obs in lowest category

clear

set obs 100

ge central = .

replace central = 2 if _n <= 2

replace central = 3 if _n > 2 & _n <= 13

replace central = 4 if _n > 13 & _n <= 76

replace central = 5 if _n > 76

ineqord central // Calculation is wrong; ignores fact that zero obs in first category

ineqord central, nlevels(5) // To calculate AN-Y and other indices correctly

European Social Survey data for Britain, round 8: happiness on a linear integer scale (0, ..., 10)

ineqord happy if cntry == "GB" & essround == 8, minlevel(0)

ineqord happy if cntry == "GB" & essround == 8 ///

, minlevel(0) catvals(k) catprops(f) ///

catcprops(F) gldv(gld) catsprops(S) gluv(glu) hplus(Hp) hminus(Hm)

sort k

list k f F gld S glu Hp Hm if !missing(F)

Stored results

Scalars

r(n_distinct_cats) Number of distinct levels in varname

r(mean) Mean of varname

r(mean_rescaled) Mean of varname if minlevel() option applied

r(median) Median of varname

r(median_rescaled) Median of varname if minlevel() option applied

r(newmedian) ceil(Median of varname)

r(Var) Variance of varname

r(sd) Standard deviation of varname

r(sumw) Sum of weights

r(N) Number of observations on varname

r(min) Minimum value of varname

r(max) Maximum value of varname

r(min_rescaled) Minimum value of varname if minlevel() option applied

r(max_rescaled) Maximum value of varname if minlevel() option applied

r(nlevels) Number of levels specified in nlevels option

r(minlevel) Value of minimum level specified in minlevel option

r(dfmeanabove) Mean of varname for obs above the median (Allison-Foster definition)

r(s_H) Mean of varname for obs above the median minus the median of varname

r(dfmeanbelow) Mean of varname for obs below the median (Allison-Foster definition)

r(s_L) Median of varname minus mean of varname for obs above the median

r(allisonfoster) Allison-Foster index

r(avjump) Average Jump index

r(apoueypt5) Apouey P2(0.5) index

r(apouey1) Apouey P2(1) index

r(apouey2) Apouey P2(2) index

r(blairlacy) Blair-Lacy index (1 - l-squared) = P2(2)

r(any11) Abul Naga-Yalcin (1,1) index

r(any21) Abul Naga-Yalcin (2,1) index

r(any12) Abul Naga-Yalcin (1,2) index

r(any41) Abul Naga-Yalcin (4,1) index

r(any14) Abul Naga-Yalcin (1,4) index

r(i0d) Cowell-Flachaire downward-looking index (alpha = 0)

r(ioneqd) Cowell-Flachaire downward-looking index (alpha = 0.25)

r(ihalfd) Cowell-Flachaire downward-looking index (alpha = 0.5)

r(ithreeqd) Cowell-Flachaire downward-looking index (alpha = 0.75)

r(ixd) Optional Cowell-Flachaire downward-looking index (alpha = #)

r(i0u) Cowell-Flachaire upward-looking index (alpha = 0)

r(ionequ) Cowell-Flachaire upward-looking index (alpha = 0.25)

r(ihalfu) Cowell-Flachaire upward-looking index (alpha = 0.5)

r(ithreequ) Cowell-Flachaire upward-looking index (alpha = 0.75)

r(ixu) Optional Cowell-Flachaire upward-looking index (alpha = #)

r(Jd) Jenkins downward-looking index

r(Ju) Jenkins upward-looking index

Locals

r(cats_list) List of levels of varname

Author

Stephen P. Jenkins <s.jenkins@lse.ac.uk>

London School of Economics and Political Science (LSE)

Acknowledgements

I developed this program as part of a project undertaken with
Arthur Grimes and Florencia Tranquilli, both of Motu Research (Wellington, New Zealand).
Benoît-Paul Hébert pointed out an issue with levelsof that affected users
with a Stata version below 15.1 (now addressed), and commented on the help-file
text. An anonymous referee also made helpful comments. The initial version of ineqord
released via the Stata Journal and SSC had a minor bug: the returned scalar value
for the Cowell-Flachaire index I(0.25) was the value for I(0.75). This has been
corrected. Thank you to anonymous correspondent "Sion" for the bug report.

References

Abdul Naga, R. and Yalcin, T. 2008.
Inequality measurement for ordered response health data.
Journal of Health Economics 27: 1614-1625.

Allison, R.A. and Foster, J.E. 2004.
Measuring health inequality using qualitative data.
Journal of Health Economics 23: 505-524.

Apouey, B. 2007.
Measuring health polarization with self-assessed health data.
Health Economics 16: 875-894.

Blair, J., and Lacy, M. 2000.
Statistics of ordinal variation.
Sociological Methods and Research 28: 251-280.

Cowell, F.A. and Flachaire, E. 2017.
Inequality with ordinal data.
Economica 84: 290-321.

Dutta, I. and Foster, J.E. 2013.
Inequality of happiness in the US: 1972-2010.
Review of Income and Wealth 59: 393-415.

Jenkins, S.P. 2019a.
Better off? Distributional comparisons for ordinal data about personal well-being.
New Zealand Economic Papers, online ahead of print. (Open Access.)
https://www.tandfonline.com/doi/full/10.1080/00779954.2019.1697729

Jenkins, S.P. 2019b.
Inequality comparisons with ordinal data.
Discussion Paper 12811. Bonn: IZA. http://ftp.iza.org/dp12811.

Kalmijn, W. and Veenhoven, R. 2005.
Measuring inequality of happiness in nations. In search of proper statistics.
Journal of Happiness Studies 6: 357-396.

Gravel, N., Magdalou, B., and Moyes, P. 2020.
Ranking distributions of an ordinal variable.
Economic Theory, online ahead of print.
https://link.springer.com/article/10.1007/s00199-019-01241-4

Also see

ordvar if installed (SSC); sdlim if installed (SSC); rhsbsample if installed (SSC)