help for egen apport()

Egen-function for apportionment methods

egen
[type]
newvar
=
apport(votesvar)
[if exp]
[in range]
[, options]

method(keyword) apportionment method

size(#|varname) seats to be allocated

threshold(#|varname) barrier clause

exceptions(exp) Exceptions from barrier clause

by(varname) apply method by groups

Description

The egen-function apport(varname)
creates a new variable holding the number of seats on the basis of the
absolute number of valid votes in varname. The apportionment
can be done by using either a quota method or five different divisor
methods are introduced. A detailed description of these methods
is given in the Stata Journal article regarding this program.

Options

method(keyword) is used to select the
apportionment method. The apportionment methods described above can be
specified using one of the following keywords:

Method Keyword and synonyms

Hamilton hamilton hare-niemeyer remainder vinton

Jefferson jefferson dhondt hagenbach-bischoff greatest

Webster webster stlague majorfraction

Hill hill huntington geometric

Dean dean harmonic

Adam adam smallest

The default is method(jefferson).

size(#|varname) is used to specify the number of
seats to be allocated. Either use a positive integer number or the
name of a variable holding the number of seats to be allocated. In the
latter case, the variable should be constant within one apportionment
problem (i.e., for one election). Size defaults to 100.

by(varlist) is used when the data set holds several
apportionment problems (i.e., several elections), or when seats should
be allocated separately for regional subdivisions. Specifying
by(varlist) is equivalent to using by varlist: as a prefix.

threshold(#|varname) is used to set the barring
clause. Within the parentheses put the size for the barring clause as
a percentage or specify the name of a variable holding the value for
the barring clause. The variable must be constant within one
apportionment problem (i.e., for one election).

exception(exp) is used to specify exceptions from the
barring clause. Within the parentheses specify an expression
indicating the exempted observations (see help exp).

Examples

. use uspop if year==1790, clear

. egen ham = apport(pop), method(hamilton) size(105)

. use uspop, clear

. egen jeff = apport(pop), method(jefferson) size(size) by(year)

Author

Ulrich Kohler, WZB, kohler@wzb.eu

Also see

Manual: [D] egen

Online: egen, egenmore (if installed)