Usage
eco(formula, data = parent.frame(), N = NULL, supplement = NULL,
context = FALSE, mu0 = 0, tau0 = 2, nu0 = 4, S0 = 10,
mu.start = 0, Sigma.start = 10, parameter = TRUE,
grid = FALSE, n.draws = 5000, burnin = 0, thin = 0,
verbose = FALSE)Arguments
formula
A symbolic description of the model to be fit,
specifying the column and row margins of $2 \times
2$ ecological tables. Y ~ X specifies Y as the
column margin and X as the row margin. Details and specif
data
An optional data frame in which to interpret the variables
in formula. The default is the environment in which
eco is called.
N
An optional variable representing the size of the unit; e.g.,
the total number of voters.
supplement
An optional matrix of supplemental data. The matrix
has two columns, which contain additional individual-level data such
as survey data for $W_1$ and $W_2$, respectively. If
NULL, no additional individual-level data are included
context
Logical. If TRUE, the contextual effect is also
modeled. See Imai and Lu (2005) for details. The default is
FALSE.
mu0
A scalar or a numeric vector that specifies the prior mean
for the mean parameter $\mu$. If it is a scalar, then its value
will be repeated to yield a vector of the length of $\mu$, otherwise,
it needs to be a vector of same length as $\mu$.
tau0
A positive integer representing the prior scale
for the mean parameter $\mu$. The default is 2.
nu0
A positive integer representing the prior degrees of
freedom of the variance matrix $\Sigma$. the default is 4.
S0
A positive scalar or a positive definite matrix that specifies
the prior scale matrix for the variance matrix $\Sigma$. If it is
a scalar, then the prior scale matrix will be a diagonal matrix with
the same dimensions as $\Sigma$ and the diagonal
mu.start
A scalar or a numeric vector that specifies the
starting values of the mean parameter $\mu$.
If it is a scalar, then its value will be repeated to
yield a vector of the length of $\mu$, otherwise,
it needs to be a vector of same length
Sigma.start
A scalar or a positive definite matrix
that specified the starting value of the variance matrix
$\Sigma$. If it is a scalar, then the prior scale
matrix will be a diagonal matrix with the same dimensions
as $\Sigma$ and the diagonal elements
parameter
Logical. If TRUE, the Gibbs draws of the population
parameters, $\mu$ and $\Sigma$, are returned in addition to
the in-sample predictions of the missing internal cells,
$W$. The default is TRUE.
grid
Logical. If TRUE, the grid method is used to sample
$W$ in the Gibbs sampler. If FALSE, the Metropolis
algorithm is used where candidate draws are sampled from the uniform
distribution on the tomography line for each
n.draws
A positive integer. The number of MCMC draws.
The default is 5000.
burnin
A positive integer. The burnin interval for the Markov
chain; i.e. the number of initial draws that should not be stored. The
default is 0.
thin
A positive integer. The thinning interval for the
Markov chain; i.e. the number of Gibbs draws between the recorded
values that are skipped. The default is 0.
verbose
Logical. If TRUE, the progress of the Gibbs
sampler is printed to the screen. The default is FALSE.