lclphom | R Documentation |
Estimates RxC vote transfer matrices (ecological contingency tables) with lclphom
lclphom( votes_election1, votes_election2, new_and_exit_voters = c("raw", "regular", "simultaneous", "full", "gold"), structural_zeros = NULL, iter.max = 1000, uniform = TRUE, distance.local = c("abs", "max", "none"), integers = FALSE, solver = "lp_solve", integers.solver = "symphony", verbose = FALSE, ... )
votes_election1 |
data.frame (or matrix) of order IxJ (likely of final order Ix(J-1)
in |
votes_election2 |
data.frame (or matrix) of order IxK (likely of final order Ix(K-1)
in |
new_and_exit_voters |
A character string indicating the level of information available
regarding new entries and exits of the election censuses between the
two elections. This argument captures the different options discussed
on Section 3 of Romero et al. (2020). This argument admits five values:
|
structural_zeros |
Default, NULL. A list of vectors of length two, indicating the election options
for which no transfer of votes are allowed between election 1 and election 2.
For instance, when new_and_exit_voters is set to |
iter.max |
Maximum number of iterations to be performed. The process ends when either the
number of iterations reaches |
uniform |
A TRUE/FALSE value that indicates if census exits affects all the electoral options in a (relatively) similar fashion in each voting unit: equation (13) of Pavia and Romero (2021a). Default, TRUE. |
distance.local |
A string argument that indicates whether the second step of the lphom_local algorithm
should be performed to solve potential indeterminacies of local solutions.
Default, |
integers |
A TRUE/FALSE value that indicates whether the problem is solved in integer values in each iteration, including zero (lphom) and local solutions. Initial LP matrices are approximate to the closest integer solution solving the corresponding Integer Linear Program. Default, FALSE. |
solver |
A character string indicating the linear programming solver to be used, only
|
integers.solver |
A character string indicating the linear programming solver to be used to approximate
to the closest integer solution, only |
verbose |
A TRUE/FALSE value that indicates if the main outputs of the function should be printed on the screen. Default, FALSE. |
... |
Other arguments to be passed to the function. Not currently used. |
Description of the new_and_exit_voters
argument in more detail.
raw
: The default value. This argument accounts for the most plausible scenario when
estimating vote transfer matrices: A scenario with two elections elapsed at least some
months where only the raw election data recorded in the I territorial units,
in which the area under study is divided, are available.
In this scenario, net exits (basically deaths) and net entries (basically
new young voters) are estimated according to equation (7) of Romero et al. (2020).
Constraints defined by equations (8) and (9) of Romero et al. (2020) and (13) of Pavia
and Romero (2021a) are imposed. In this scenario, when net exits and/or net entries
are negligible (such as between the first- and second-round of French Presidential
elections), they are omitted in the outputs.
regular
: For estimating vote transfer matrices, this value accounts for a scenario with
two elections elapsed at least some months where (i) the column J of votes_election1
corresponds to new young electors who have the right to vote for the first time, (ii)
net exits (basically a consequence of mortality), and maybe other additional net entries,
are computed according equation (7) of Romero et al. (2020), and (iii), when
uniform = TRUE
, within each unit it is assummed that net exits affect
equally all the first J-1 options of election 1, i.e., equation (13) of Pavia
and Romero (2021a) is applied. Constraints (8) and (9) of Romero et al. (2020)
are imposed to start the process.
simultaneous
: This is the value to be used in a classical ecological inference problems,
such as for racial voting, and in a scenario with two simultaneous elections.
In this scenario, the sum by rows of votes_election1
and votes_election2
must coincide.
Constraints defined by equations (8) and (9) of Romero et al. (2020) and (13) of Pavia and
Romero (2021a) are not included in the model.
full
: This value accounts for a scenario with two elections elapsed at least some
months, where: (i) the column J-1 of votes_election1
totals new young
electors that have the right to vote for the first time; (ii) the column J
of votes_election1
measures new immigrants that have the right to vote; and
(iii) the column K of votes_election2
corresponds to total exits of the census
lists (due to death or emigration). In this scenario, the sum by rows of
votes_election1
and votes_election2
must agree and constraints (8)
and (9) of Romero et al. (2020) are imposed.
gold
: This value accounts for a scenario similar to full, where total exits are
separated out between exits due to emigration (column K-1 of votes_election2
)
and death (column K of votes_election2
). In this scenario, the sum by rows
of votes_election1
and votes_election2
must agree. The same restrictions
as in the above scenario apply but for both columns K-1 and K of the vote
transition probability matrix
A list with the following components
VTM |
A matrix of order JxK with the estimated percentages of row-standardized vote transitions from election 1 to election 2. |
VTM.votes |
A matrix of order JxK with the estimated vote transitions from election 1 to election 2. |
OTM |
A matrix of order KxJ with the estimated percentages of the origin of the votes obtained for the different options of election 2. |
HETe |
The estimated heterogeneity index as defined in equation (15) of Pavia and Romero (2021a). |
VTM.complete |
A matrix of order J'xK' with the estimated proportions of row-standardized vote transitions from election 1 to election 2, including in |
VTM.complete.votes |
A matrix of order J'xK' with the estimated vote transitions from election 1 to election 2, including in |
VTM.prop.units |
An array of order J'xK'xI with the estimated proportions of vote transitions from election 1 to election 2 attained for each unit in the solution. |
VTM.votes.units |
An array of order J'xK'xI with the estimated matrix of vote transitions from election 1 to election 2 attained for for each unit in the solution. |
VTM.complete.last.iter |
A matrix of order J'xK' with the estimated proportions of vote transitions from election 1 to election 2, including in |
VTM.sequence |
Array of order J'xK'x(iter+1) (where |
HETe.sequence |
Numeric vector of length |
VTM.prop.units.last.iter |
An array of order J'xK'xI with the estimated proportions of vote transitions from election 1 to election 2 attained for each unit in the final iteration. |
VTM.votes.units.last.iter |
An array of order J'xK'xI with the estimated matrix of vote transitions from election 1 to election 2 attained for each unit in the final iteration. |
zeros |
A list of vectors of length two, indicating the election options for which no transfer of votes are allowed between election 1 and election 2. |
iter |
The real final number of iterations performed before ending the process. |
iter.units |
A matrix of order Ix(iter+1) with the number of iteration corresponding to the solution selected for each unit in each iteration. |
errors |
A vector of length I with the minimal error observed in the sequence for each unit. It corresponds to
the unit-error associated with the solution linked with either |
inputs |
A list containing all the objects with the values used as arguments by the function. |
origin |
A matrix with the final data used as votes of the origin election after taking into account the level of information available regarding to new entries and exits of the election censuses between the two elections. |
destination |
A matrix with the final data used as votes of the origin election after taking into account the level of information available regarding to new entries and exits of the election censuses between the two elections. |
EHet |
A matrix of order IxK measuring in each spatial unit a distance to the homogeneity hypothesis, that is, the differences under the homogeneity hypothesis between the actual recorded results and the expected results with the solution in each territorial unit for each option of election 2. |
solution_init |
A list with the main outputs produced by lphom(). |
VTM_init
: A matrix of order JxK with the estimated percentages of vote transitions from election 1 to election 2 initially obtained by lphom().
VTM.votes_init
: A matrix of order JxK with the estimated vote transitions from election 1 to election 2 initially obtained by lphom().
OTM_init
: A matrix of order KxJ with the estimated percentages of the origin of the votes obtained for the different options of election 2 initially obtained by lphom().
HETe_init
: The estimated heterogeneity index defined in equation (10) of Romero et al. (2020).
EHet_init
: A matrix of order IxK measuring in each spatial unit the distance to the homogeneity hypothesis, that is, the differences under the homogeneity hypothesis between the actual recorded results and the expected results, using the lphom() solution, in each territorial unit for each option of election 2.
VTM.complete_init
: A matrix of order J'xK' with the estimated proportions of vote transitions from election 1 to election 2 initially obtained by lphom(), including in regular
and raw
scenarios the row and the column corresponding to net_entries and net_exits even when they are really small, less than 1% in all units.
VTM.complete.votes_init
: A matrix of order J'xK' with the estimated vote transitions from election 1 to election 2 initially obtained by lphom(), including in regular
and raw
scenarios the row and the column corresponding to net_entries and net_exits even when they are really small, less than 1% in all units.
Jose M. Pavia, pavia@uv.es
lphom
tslphom
nslphom
Other linear programing ecological inference functions:
lp_apriori()
,
lphom_dual()
,
lphom_joint()
,
lphom()
,
nslphom_dual()
,
nslphom_joint()
,
nslphom()
,
tslphom_dual()
,
tslphom_joint()
,
tslphom()
mt.lc <- lclphom(France2017P[, 1:8] , France2017P[, 9:12], new_and_exit_voters= "raw") mt.lc$VTM mt.lc$HETe mt.lc$solution_init$HETe_init
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.