Description Usage Arguments Details Author(s) References Examples
ei
is the main command in the package EI
. It gives observation-level estimates (and various related statistics) of β_i^b and β_i^w given variables T_i and X_i (i=1,...,n) in this accounting identity: T_i=β_i^b*X_i + β_i^w*(1-X_i). Results are stored in an ei
object, that can be read with summary()
or eiread()
and graphed in plot()
.
1 2 3 4 5 6 | ei(formula, total = NULL, Zb = 1, Zw = 1, id = NA, data =NA, erho = 0.5,
esigma = 0.5, ebeta = 0.5, ealphab = NA, ealphaw = NA, truth = NA,
simulate = TRUE, covariate = NULL, lambda1 = 4, lambda2 = 2,
covariate.prior.list = NULL, tune.list = NULL, start.list = NULL,
sample = 1000, thin = 1, burnin = 1000, verbose = 0, ret.beta = "r",
ret.mcmc = TRUE, usrfun = NULL)
|
formula |
A formula of the form t ~x in the 2x2 case and cbind(col1,col2,...) ~ cbind(row1,row2,...) in the RxC case. |
total |
‘total’ is the name of the variable in the dataset that contains the number of individuals in each unit |
Zb |
p x k^b matrix of covariates or the name of covariates in the dataset |
Zw |
p x k^w matrix of covariates or the name of covariates in the dataset |
id |
‘id’ is the nae of the variable in the dataset that identifies the precinct. Used for ‘movie’ and ‘movieD’ plot functions. |
data |
data frame that contains the variables that
correspond to formula. If using covariates and data is specified, data should also contain |
erho |
The standard deviation of the normal prior on φ_5 for the correlation. Default =0.5. |
esigma |
The standard deviation of an underlying normal distribution, from which a half normal is constructed as a prior for both \breve{σ}_b and \breve{σ}_w. Default = 0.5 |
ebeta |
Standard deviation of the "flat normal" prior on \breve{B}^b and \breve{B}^w. The flat normal prior is uniform within the unit square and dropping outside the square according to the normal distribution. Set to zero for no prior. Setting to positive values probabilistically keeps the estimated mode within the unit square. Default=0.5 |
ealphab |
cols(Zb) x 2 matrix of means (in the first column) and standard deviations (in the second) of an independent normal prior distribution on elements of α^b. If you specify Zb, you should probably specify a prior, at least with mean zero and some variance (default is no prior). (See Equation 9.2, page 170, to interpret α^b). |
ealphaw |
cols(Zw) x 2 matrix of means (in the first column) and standard deviations (in the second) of an independent normal prior distribution on elements of α^w. If you specify Zw, you should probably specify a prior, at least with mean zero and some variance (default is no prior). (See Equation 9.2, page 170, to interpret α^w). |
truth |
A length(t) x 2 matrix of the true values of the quantities of interest. |
simulate |
default = TRUE:see documentation in |
covariate |
see documentation in |
lambda1 |
default = 4:see documentation in |
lambda2 |
default = 2:see documentation in |
covariate.prior.list |
see documentation in |
tune.list |
see documentation in |
start.list |
see documentation in |
sample |
default = 1000 |
thin |
default = 1 |
burnin |
default = 1000 |
verbose |
default = 0:see documentation in |
ret.beta |
default = "r": see documentation in |
ret.mcmc |
default = TRUE: see documentation in |
usrfun |
see documentation in |
The EI
algorithm is run using the ei
command. A summary of the results can be seen graphically using plot(ei.object)
or numerically using summary(ei.object)
. Quantities of interest can be calculated using eiread(ei.object)
.
Gary King <<email: king@harvard.edu>> and Molly Roberts <<email: molly.e.roberts@gmail.com>>
Gary King (1997). A Solution to the Ecological Inference Problem. Princeton: Princeton University Press.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.