lphom_joint: Implements the lphom_joint algorithm

View source: R/lphom_joint.R

lphom_jointR Documentation

Implements the lphom_joint algorithm

Description

Estimates RxC vote transfer matrices (ecological contingency tables) with lphom_joint

Usage

lphom_joint(
  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_election1 and votes_election2 must coincide.

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. In general, The sum by rows of votes_election1 and votes_election2 must coincide.

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 lp_solve and symphony are allowed. By default, lp_solve. The package Rsymphony needs to be installed for the option symphony to be used.

integers.solver

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.

...

Other arguments to be passed to the function. Not currently used.

Value

A list with the following components

VTM.votes

A matrix of order JxK with the estimated cross-distribution of votes of elections 1 and 2.

HETe

The estimated heterogeneity index associated to the VTM.votes solution.

VTM12

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.

VTM21

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.

EHet12

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.

EHet21

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.

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 (2021). Symmetry estimating RxC vote transfer matrices from aggregate data, mimeo.

See Also

lphom lphom_dual tslphom_dual nslphom_dual tslphom_joint nslphom_joint

Other linear programing ecological inference functions: lclphom(), lp_apriori(), lphom_dual(), lphom(), nslphom_dual(), nslphom_joint(), nslphom(), tslphom_dual(), tslphom_joint(), tslphom()

Examples

x <- France2017P[, 1:8]
y <- France2017P[, 9:12]
y[,1] <- y[,1]  - (rowSums(y) - rowSums(x))
mt <- lphom_joint(x, y)
mt$VTM.votes
mt$HETe

lphom documentation built on March 21, 2022, 9:09 a.m.

Related to lphom_joint in lphom...