lphom_dual {lphom} | R Documentation |
Implements lphom_dual algorithm
Description
Estimates RxC vote transfer matrices (ecological contingency tables) with lphom_dual
Usage
lphom_dual(
votes_election1,
votes_election2,
integers = FALSE,
solver = "lp_solve",
integers.solver = "symphony",
...
)
Arguments
votes_election1 |
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_election2 |
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 |
integers |
A TRUE/FALSE value that indicates whether the LP solution of counts (votes) must be approximate to the closest integer solution using ILP. 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 |
... |
Other arguments to be passed to the function. Not currently used. |
Value
A list with the following components
VTM.votes.w |
The matrix of order JxK with the estimated cross-distribution of votes of elections 1 and 2, attained weighting the two dual solutions using as weights the corresponding HTEe estimates. |
VTM.votes.a |
The matrix of order JxK with the estimated cross-distribution of votes of elections 1 and 2, attained simple averaging the two dual solutions. |
HETe.w |
Estimated heterogeneity index associated to the |
HETe.a |
Estimated heterogeneity index associated to the |
VTM12.w |
The matrix of order JxK with the estimated row-standardized proportions of vote transitions from election 1 to election 2 associated to the |
VTM21.w |
The matrix of order KxJ with the estimated row-standardized proportions of vote transitions from election 2 to election 1 associated to the |
VTM12.a |
The matrix of order JxK with the estimated row-standardized proportions of vote transitions from election 1 to election 2 associated to the |
VTM21.a |
The matrix of order KxJ with the estimated row-standardized proportions of vote transitions from election 2 to election 1 associated to the |
lphom.object.12 |
The output of the |
lphom.object.21 |
The output of the |
inputs |
A list containing all the objects with the values used as arguments by the function. |
Author(s)
Jose M. Pavia, pavia@uv.es
Rafael Romero rromero@eio.upv.es
References
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, forthcoming. doi:10.1093/jrsssa/qnae013
See Also
lphom
tslphom_dual
nslphom_dual
lphom_joint
tslphom_joint
nslphom_joint
Other linear programing ecological inference functions:
lclphom()
,
lp_apriori()
,
lphom_joint()
,
lphom()
,
nslphom_dual()
,
nslphom_joint()
,
nslphom()
,
rslphom()
,
tslphom_dual()
,
tslphom_joint()
,
tslphom()
Examples
x <- France2017P[, 1:8]
y <- France2017P[, 9:12]
y[,1] <- y[,1] - (rowSums(y) - rowSums(x))
mt <- lphom_dual(x, y)
mt$VTM.votes.w
mt$HETe.w