convertEiData {eiwild} | R Documentation |
Extracting important values for calculation of the
ecological Inference with the
runMBayes
-function
convertEiData(form, aggr, indi = NULL, IDCols = c("ID"))
form |
|
aggr |
|
indi |
|
IDCols |
vector of length 2 giving the column-names or numbers of ID column |
indi
is a districts x [(r*c)+1]
data.frame
containing one district per line. One
column gives the ID of the districts which will be
connection to the ID column in the aggr
-data.frame.
For example a 2x3 ecological Inference problem with
formula
cbind(col1,col2,col3) ~
cbind(row1,row2)
will have the row format : [ID,
row1.col1, row1.col2, row1.col3, row2.col1, row2.col2,
row2.col3]
It is important that the formula
names correspond to
the exact column number in the indi-data.frame.
list
with components needed for the Metropolis
algorithm in runMBayes
## Not run: # loading some fake election data data(topleveldat) form <- cbind(CSU_2, SPD_2, LINK_2, GRUN_2) ~ cbind(CSU_1, SPD_1, Link_1) conv <- convertEiData(form=form, aggr=aggr, indi=indi, IDCols=c("ID", "ID")) str(conv) ## End(Not run)