Learn R Programming

MCMCpack (version 0.4-9)

MCMCbaselineEI: Markov chain Monte Carlo for Wakefield's Baseline Ecological Inference Model

Description

MCMCbaselineEI is used to fit Wakefield's baseline ecological inference model for partially observed 2 x 2 contingency tables.

Usage

MCMCbaselineEI(r0, r1, c0, c1, burnin=1000, mcmc=50000, thin=10,
               tune=2.65316, verbose=FALSE, seed=0, alpha0=1, beta0=1,
               alpha1=1, beta1=1, method="NA", ...)

Arguments

r0
$(ntables \times 1)$ vector of row sums from row 0.
r1
$(ntables \times 1)$ vector of row sums from row 1.
c0
$(ntables \times 1)$ vector of column sums from column 0.
c1
$(ntables \times 1)$ vector of column sums from column 1.
burnin
The number of burn-in scans for the sampler.
mcmc
The number of mcmc scans to be saved.
thin
The thinning interval used in the simulation. The number of mcmc iterations must be divisible by this value.
tune
Tuning parameter for the Metropolis-Hasting sampling.
verbose
A switch which determines whether or not the progress of the sampler is printed to the screen. Information is printed if TRUE.
seed
The seed for the random number generator. The code uses the Mersenne Twister, which requires an integer as an input. If nothing is provided, the Scythe default seed is used.
alpha0
alpha parameter for the beta prior on $p_0$.
beta0
beta parameter for the beta prior on $p_0$.
alpha1
alpha parameter for the beta prior on $p_1$.
beta1
beta parameter for the beta prior on $p_1$.
method
Parameter determining whether a data augmentation algorithm should be used on the exact posterior (``DA"), or a Metropolis-Hastings algorithm should be used on Wakefield's normal approximation to the posterior (``NA"). For tables with larg
...
further arguments to be passed

Value

  • An mcmc object that contains the posterior density sample. This object can be summarized by functions provided by the coda package.

Details

Consider the following partially observed 2 by 2 contingency table: llll{ | $Y=0$ | $Y=1$ | - - - - - - - - - - - - - - - - - - - - $X=0$ | $Y_0$ | | $r_0$ - - - - - - - - - - - - - - - - - - - - $X=1$ | $Y_1$ | | $r_1$ - - - - - - - - - - - - - - - - - - - - | $c_0$ | $c_1$ | $N$ }

where $r_0$, $r_1$, $c_0$, $c_1$, and $N$ are non-negative integers that are observed. The interior cell entries are not observed. It is assumed that $Y_0|r_0 \sim \mathcal{B}inomial(r_0, p_0)$ and $Y_1|r_1 \sim \mathcal{B}inomial(r_1, p_1)$. Inference centers on $p_0$ and $p_1$. Wakefield's baseline model starts with the assumption that a priori $p_0 \sim \mathcal{B}eta(\alpha_0, \beta_0)$ and $p_1 \sim \mathcal{B}eta(\alpha_1, \beta_1)$.

References

Jonathan Wakefield. 2001. ``Ecological Inference for 2 x 2 Tables," Center for Statistics and the Social Sciences Working Paper no. 12. University of Washington.

Andrew D. Martin, Kevin M. Quinn, and Daniel Pemstein. 2003. Scythe Statistical Library 0.4. http://scythe.wustl.edu. Martyn Plummer, Nicky Best, Kate Cowles, and Karen Vines. 2002. Output Analysis and Diagnostics for MCMC (CODA). http://www-fis.iarc.fr/coda/.

See Also

MCMChierEI, MCMCdynamicEI, plot.mcmc,summary.mcmc

Examples

Run this code
posterior <- MCMCbaselineEI(300, 200, 100, 400)
   plot(posterior)
   summary(posterior)

Run the code above in your browser using DataLab