help for er (Version 1.1)Carlos Gradín (April 2014)

Polarization index, Esteban and Ray (Econometrica, 1994)

Syntax

er varname [weights] [if exp] [in range] [, alpha(# [# # ...]) normalize(ln | mean | none) nonaggregate ]

varname indicates the variable of interest (ex. income, expenditure, ...).

fweights, aweights and aweights are allowed; see weights.

Description

er computes the polarization index proposed by Esteban and Ray (1994) for the requested values of the alpha parameter (the degree of "polarization sensitivity").

It uses either individual data or data aggregated by groups.

Formula

ER(alpha) = sum_i {sum_j [pi^(1+alpha)*pj*|yi-yj|]}

Where yi is each (normalized) value of varname, pi is the (weighted) proportion of individuals with yi, and alpha (between 1.0 and 1.6) is the degree of "polarization sensitivity".

- Aggregation

By default, yi represents each distinct value of varname, pi is the weighted proportion of observations with same yi, and the number of groups equals the number of distinct values of varname.
That is, two or more observations with the same value of varname are aggregated as if they belonged to the same group.
This uses the command tabulate, so the maximum number of groups depends on the limit applicable for the number of rows in that command).

To treat each observation as a separate group, use the option nonaggregate. In that case, the number of groups equals the number of observations.
Given that it does not use tabulate, this option might also be useful to overcome the limit of distinct groups of that command.
For that, make sure that you collapse your dataset so that each observation is a different group, before running er (see example below).

- Normalization

By default, yi is ln(varname). For alternative normalizations (none or division by the mean) use the corresponding options.

Warning: The time needed for the computation might be long if the number of groups is large. Especially, if the option nonaggregate is used with a large number of observations.

Options

alpha : values of alpha to be reported. By default: alpha(1.0 1.3 1.6).

normalize() to choose how to normalize varname. By default: normalize(ln).

normalize(ln) to compute natural log of varname, the default.

normalize(mean) to divide varname by the mean.

normalize(none) to use unnormalized varname.

nonaggregate to treat each observation as a distinct group (prevent eggregating observations with same values of varname)

Saved results

Scalars:

r(er_1), r(er_2) ...

Examples

. use erdata.dta, clear

. list

Observations with same income are aggregated (ex. 1 and 2, 3 and 4, ...):

. er income [aw=weight]

Or equivalently, collapsing by income to avoid the limits of tabulate

. collapse (sum) weight, by(income)

. list

. er income [aw=weight], n

Changing normalization and requested values of alpha, using a subsample

. use erdata.dta, clear

. er income [aw=weight] if region==1, a(1.0 1.2 1.4) n(mean)

. er income [aw=weight], a(1.3) n(none)

Observations with same income are not aggregated (they are treated as different groups):

. er income [aw=weight], n

For bootstrapping (BC estimates), using saved scalars

cap program drop estray

program def estray

er income [aw=weight]

end

bootstrap r(er_1) r(er_2) r(er_3) , reps(1000): estray

estat bootstrap

Author

Carlos Gradín
<cgradin@uvigo.es>

Facultade de CC. Económicas

Universidade de Vigo

36310 Vigo, Galicia, Spain.

References

Esteban, Joan Maria and Debraj Ray (1994), On the Measurement of Polarization, Econometrica, 62(4):819-851.

Also see

rq if installed.