MCMCbaselineEI           package:MCMCpack           R Documentation

_M_a_r_k_o_v _c_h_a_i_n _M_o_n_t_e _C_a_r_l_o _f_o_r _W_a_k_e_f_i_e_l_d'_s _B_a_s_e_l_i_n_e _E_c_o_l_o_g_i_c_a_l
_I_n_f_e_r_e_n_c_e _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     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", ...)
        

_A_r_g_u_m_e_n_t_s:

      r0: (ntables * 1) vector of row sums from row 0.

      r1: (ntables * 1) vector of row sums from row 1.

      c0: (ntables * 1) vector of column sums from column 0.

      c1: (ntables * 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 p0.

   beta0: beta parameter for the beta prior on p0.

  alpha1: alpha parameter for the beta prior on p1.

   beta1: beta parameter for the beta prior on p1.

  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 large row and column sums, the preferred method is
          ``NA."

     ...: further arguments to be passed

_D_e_t_a_i_l_s:

     Consider the following partially observed 2 by 2 contingency
     table:


                  | Y=0      | Y=1      |
       - - - - -  - - - - -  - - - - -  - - - - -
       X=0        | Y0       |          | r0
       - - - - -  - - - - -  - - - - -  - - - - -
       X=1        | Y1       |          | r1
       - - - - -  - - - - -  - - - - -  - - - - -
                  | c0       | c1       | N

     where r0, r1, c0, c1, and N  are non-negative integers that are
     observed. The interior cell entries are not observed. It is
     assumed that Y0|r0 ~ Binomial(r0, p0) and Y1|r1 ~ Binomial(r1,p1).
     Inference centers on p0 and p1. Wakefield's baseline model starts
     with the assumption that a priori p0 ~ Beta(alpha0, beta0) and p1
     ~ Beta(alpha1, beta1).

_V_a_l_u_e:

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

_R_e_f_e_r_e_n_c_e_s:

     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._ <URL: http://scythe.wustl.edu>.

     Martyn Plummer, Nicky Best, Kate Cowles, and Karen Vines. 2002.
     _Output Analysis and Diagnostics for MCMC (CODA)_. <URL:
     http://www-fis.iarc.fr/coda/>.

_S_e_e _A_l_s_o:

     'MCMChierEI', 'MCMCdynamicEI', 'plot.mcmc','summary.mcmc'

_E_x_a_m_p_l_e_s:

        ## Not run: 
        posterior <- MCMCbaselineEI(300, 200, 100, 400)
        plot(posterior)
        summary(posterior)
        
     ## End(Not run)

