Last chance! 50% off unlimited learning
Sale ends in
ecoBD
is used to calculate the bounds for missing internal cells of
ecoBD(formula, data = parent.frame(), N = NULL)
An object of class ecoBD
containing the following elements
(When three dimensional arrays are used, the first dimension indexes the
observations, the second dimension indexes the row numbers, and the third
dimension indexes the column numbers):
The matched call.
A matrix of the observed row margin,
A matrix of the observed column margin,
A vector of the size of ecological tables,
A three dimensional array of aggregate lower bounds for proportions.
A three dimensional array of aggregate upper bounds for proportions.
A three dimensional array of lower bounds for proportions.
A three dimensional array of upper bounds for proportions.
A three dimensional array of lower bounds for counts.
A three dimensional array of upper bounds for counts.
The object
can be printed through print.ecoBD
.
A symbolic description of ecological table to be used,
specifying the column and row margins of
An optional data frame in which to interpret the variables in
formula
. The default is the environment in which ecoBD
is
called.
An optional variable representing the size of the unit; e.g., the
total number of voters. If formula
is entered as counts and the last
row and/or column is omitted, this input is necessary.
The data may be entered either in the form of counts or proportions. If
proportions are used, formula
may omit the last row and/or column of
tables, which can be calculated from the remaining margins. For example,
Y ~ X
specifies Y
as the first column margin and X
as
the first row margin in formula
may omit the last row and/or column margin of the table only
if N
is supplied. In this example, the columns will be labeled as
X
and not X
, and the rows will be labeled as Y
and
not Y
.
For larger tables, one can use cbind()
and +
. For example,
cbind(Y1, Y2, Y3) ~ X1 + X2 + X3 + X4)
specifies
An
... | ||||
... | ||||
... | ... | ... | ... | ... |
... | ||||
... |
where N
, is
provided,
An
... | ||||
... | ||||
... | ... | ... | ... | ... |
... | ||||
... |
where
Imai, Kosuke, Ying Lu and Aaron Strauss. (2011) “eco: R Package for Ecological Inference in 2x2 Tables” Journal of Statistical Software, Vol. 42, No. 5, pp. 1-23.
Imai, Kosuke, Ying Lu and Aaron Strauss. (2008) “Bayesian and Likelihood Inference for 2 x 2 Ecological Tables: An Incomplete Data Approach” Political Analysis, Vol. 16, No. 1, (Winter), pp. 41-69.
eco
, ecoNP
## load the registration data
data(reg)
## calculate the bounds
res <- ecoBD(Y ~ X, N = N, data = reg)
## print the results
print(res)
Run the code above in your browser using DataLab