Estimates RxC vote transfer matrices (ecological contingency tables) with nslphom_joint
nslphom_joint(
votes_election1,
votes_election2,
iter.max = 10,
min.first = FALSE,
integers = FALSE,
solver = "lp_solve",
integers.solver = "symphony",
tol = 0.001,
...
)
A list with the following components
A matrix of order JxK with the estimated cross-distribution of votes of elections 1 and 2.
The estimated heterogeneity index associated to the VTM.votes
solution.
The matrix of order JxK with the estimated row-standardized proportions of vote transitions from election 1 to election 2 associated to the VTM.votes
solution.
The matrix of order KxJ with the estimated row-standardized proportions of vote transitions from election 2 to election 1 associated to the VTM.votes
solution.
An array of order JxKxI with the estimated matrix of cross-distributions of votes of elections 1 and 2 attained for each unit in iteration of the solution.
The real final number of iterations performed before ending the process.
Number of the iteration associated to the selected VTM.votes
solution.
A matrix of order IxK measuring in each unit a distance to the homogeneity hypothesis. That is, the differences under the homogeneity hypothesis between the actual recorded results and the expected results in each territorial unit for each option of election two. The matrix Eik.
A matrix of order IxJ measuring in each unit a distance to the homogeneity hypothesis. That is, the differences under the homogeneity hypothesis between the actual recorded results and the expected results in each territorial unit for each option of election one. The matrix Eij.
A list of two matrices of order JxK and two arrays of order JxKxI containing for each vote transition the lower and upper allowed proportions given the observed aggregates.
A list containing all the objects with the values used as arguments by the function.
A list with the main outputs produced by lphom_joint().
data.frame (or matrix) of order IxJ with the counts to be initially
mapped to rows. When estimating vote transfer matrices, the votes gained by
the J political options competing on election 1 (or origin) in the I
territorial units considered. The sum by rows of votes_election1
and
votes_election2
must coincide.
data.frame (or matrix) of order IxK with the counts to be initially mapped
to columns. When estimating vote transfer matrices, the votes gained by
the K political options competing on election 2 (or destination) in the I
territorial units considered. The sum by rows of votes_election1
and
votes_election2
must coincide.
Maximum number of iterations to be performed. The process ends independently when either
the number of iterations reaches iter.max or when the maximum variation between two
consecutive estimates of both ways probability transfer matrices are less than tol
.
By default, 10.
A TRUE/FALSE
value. If FALSE
, the matrix associated with the minimum HETe
after
performing iter.max
iterations is taken as solution.
If TRUE
, the associated matrix to the instant in which the first decrease of HETe
occurs
is taken as solution. The process stops at that moment. In this last scenario
(when min.first = TRUE
), iter.max
is is forced to be at least 100. Default, FALSE
.
A TRUE/FALSE
value that indicates whether the problem is solved in integer values in
each iteration: zero (lphom) and intermediate and final (including unit) solutions.
If TRUE
, the initial LP matrices are approximated in each iteration to the closest integer solution
solving the corresponding Integer Linear Program. Default, FALSE
.
A character string indicating the linear programming solver to be used, only
lp_solve
and symphony
are allowed. By default, lp_solve
. The package Rsymphony
needs to be installed for the option symphony
to be used.
A character string indicating the linear programming solver to be used to approximate
to the closest integer solution, only symphony
and lp_solve
are allowed.
By default, symphony
. The package Rsymphony
needs to be installed for the option symphony
to be used. Only used when integers = TRUE
.
Maximum deviation allowed between two consecutive iterations. The process ends when the maximum
variation between the estimated cross-distributions of votes between two consecutive
iterations is less than tol
or the maximum number of iterations, iter.max
, has been reached. By default, 0.001.
Other arguments to be passed to the function. Not currently used.
Jose M. Pavia, pavia@uv.es
Rafael Romero rromero@eio.upv.es
Pavia, JM and Romero, R (2024). Symmetry estimating RxC vote transfer matrices from aggregate data. Journal of the Royal Statistical Society, Series A – Statistics in Society, 187(4), 919-943. tools:::Rd_expr_doi("10.1093/jrsssa/qnae013")
nslphom
lphom_dual
tslphom_dual
nslphom_dual
lphom_joint
tslphom_joint
Other linear programing ecological inference functions:
lclphom()
,
lp_apriori()
,
lphom_dual()
,
lphom_joint()
,
lphom()
,
nslphom_dual()
,
nslphom()
,
rslphom()
,
tslphom_dual()
,
tslphom_joint()
,
tslphom()
x <- France2017P[, 1:8]
y <- France2017P[, 9:12]
y[,1] <- y[,1] - (rowSums(y) - rowSums(x))
mt <- nslphom_joint(x, y, iter.max = 3)
mt$VTM.votes
mt$HETe
Run the code above in your browser using DataLab