MCMCirt1d              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 _O_n_e _D_i_m_e_n_s_i_o_n_a_l _I_t_e_m _R_e_s_p_o_n_s_e _T_h_e_o_r_y
_M_o_d_e_l

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

     This function generates a posterior density sample from a one
     dimentional item response theory (IRT) model, with Normal priors
     on the subject abilities (ideal points), and multivariate Normal
     priors on the item parameters.  The user supplies data and priors,
     and a sample from the posterior density is returned as an mcmc
     object, which can be subsequently analyzed with functions provided
     in the coda package.

     _NOTE:_ This implementation of this model may be deprecated in
     future releases.  We have implemented a general K-dimensional item
     response theory model that allows the user to place arbitrary
     constraints on item and subject parameters.

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

     MCMCirt1d(datamatrix, theta.fixed = 1, burnin = 500, mcmc = 1000,
        thin=5, verbose = FALSE, seed = 0, theta.start = NA, 
        alpha.start = NA, beta.start = NA, t0 = 0, T0 = 1, b0.alpha = 0,
        b0.beta = 0, B0.alpha = 1, B0.beta = 1, B0.corr = 0,
        store.item = FALSE, ... )  

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

datamatrix: The matrix of data.  Must be 0, 1, or missing values.   It
          is of dimensionality items by subjects.

theta.fixed: Identifying restriction.  This is the subject whose
          subject ability (ideal point) is constrained to be negative. 
          It makes most sense to choose someone who is extreme on the
          latent scale.  Make sure to check the posterior density
          sample to ensure the sampler is sampling from only one
          posterior mode.

  burnin: The number of burn-in iterations for the sampler.

    mcmc: The number of Gibbs iterations for the sampler.

    thin: The thinning interval used in the simulation.  The number of
          Gibbs iterations must be divisible by this value.

 verbose: A switch which determines whether or not the progress of the
          sampler is printed to the screen.  If TRUE, the iteration
          number and the subject abilities (ideal points) are printed
          to the screen.

    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.

theta.start: The starting values for the subject abilities (ideal
          points).   This can either be a scalar or a column vector
          with dimension equal to the number of voters.   If this takes
          a scalar value, then that value will serve as the starting
          value for all of the thetas.  The default value of NA will
          choose the starting values randomly.

alpha.start: The starting values for the alpha difficulty parameters.
          This can either be a scalar or a column vector with dimension
          equal to the number of items.   If this takes a scalar value,
          then that value will serve as the starting value for all of
          the alphas. The default value of NA will choose the starting
          values randomly.

beta.start: The starting values for the beta discrimination parameters.
          This can either be a scalar or a column vector with dimension
          equal to the number of items.   If this takes a scalar value,
          then that value will serve as the starting value for all of
          the betas.  The default value of NA will choose the starting
          values randomly.

      t0: The prior means of the subject abilities (ideal points),
          stacked for all subjects.  This can either be a scalar or a
          column vector with dimension equal to the number of thetas.
          If this takes a scalar value, then that value will serve as
          the prior mean for all of the betas.

      T0: The prior variances of the subject abilities (ideal points),
          stacked for all subjects.   This can either be a scalar or a
          column vector with dimension equal to the number of thetas.
          If this takes a scalar  value, then that value will serve as
          the prior variance for all of the thetas.

b0.alpha: The prior means of the difficulty parameters, stacked for all
          items. This can either be a scalar or a column vector with
          dimension equal to the number of alphas. If this takes a
          scalar value, then that value will serve as the prior mean
          for all of the alphas.

 b0.beta: The prior means of the discrimination parameters, stacked for
          all items. This can either be a scalar or a column vector
          with dimension equal to the number of betas. If this takes a
          scalar value, then that value will serve as the prior mean
          for all of the betas.

B0.alpha: The prior variances of the difficulty parameters, stacked for
          all items. This can either be a scalar or a column vector
          with dimension equal to the number of alphas. If this takes a
          scalar  value, then that value will serve as the prior
          variance for all of the alphas.

 B0.beta: The prior variances of the discrimination parameters, stacked
          for all items. This can either be a scalar or a column vector
          with dimension equal to the number of betas. If this takes a
          scalar  value, then that value will serve as the prior
          variance for all of the betas.

 B0.corr: The prior correlations of the difficulty and discrimination
          parameters, stacked for all items.  These are converted into
          covariances to complete the multivariate Normal prior.  This
          can either be a scalar or a column vector with dimension
          equal to the number of items. If this takes a scalar  value,
          then that value will serve as the prior correlation for all
          of the items.

store.item: A switch that determines whether or not to store the item
          parameters for posterior analysis.  _NOTE: This takes an
          enormous amount of memory, so should only be used if the
          chain is thinned heavily, or for applications with a small
          number of items_.  By default, the item parameters are not
          stored.

     ...: further arguments to be passed

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

     'MCMCirt1d' simulates from the posterior density using standard
     Gibbs sampling using data augmentation (a Normal draw for the
     subject abilities, a multivariate Normal draw for the item
     parameters, and a truncated Normal draw for the latent utilities).
     The simulation proper is done in compiled C++ code to maximize
     efficiency.  Please consult the coda documentation for a
     comprehensive list of functions that can be used to analyze the
     posterior density sample.

     The default number of burnin and mcmc iterations is much smaller
     than the typical default values in MCMCpack.  This is because
     fitting this model is extremely computationally expensive.  It
     does not mean that this small of a number of scans will yield good
     estimates. If the verbose option is chosen, output will be printed
     to the screen every fifty iterations.  The priors of this model
     need to be proper for identification purposes.  The user is asked
     to provide prior means and variances _(not precisions)_ for the
     item parameters and the subject parameters.

     The model takes the following form.  We assume that each subject
     has an subject ability (ideal point) denoted theta_j and that each
     item has a difficulty parameter alpha_i and discrimination
     parameter beta_i.  The observed choice by subject j on item i is
     the observed data matrix which is (I * J).  We assume that the
     choice is dictated by an unobserved utility: 

             z_ij = alpha_i + beta_i*theta_j + epsilon_ij

     Where the errors are assumed to be distributed standard Normal. 
     The parameters of interest are the subject abilities (ideal
     points) and the item parameters.

     We assume the following priors.  For the subject abilities (ideal
     points):

                        theta_j ~ N(t_0j, T0j)

     Note that this implies a separate prior mean and variance for each
     subject.  For the item parameters, the prior is:

                [alpha_i beta_i]' ~ N_2 (b_0,i, B_0,i)

     Again, there is a separate prior for each item parameter.  When 
     supplying priors of the item parameters to the function, the user
     provides  each element of the mean vector and the covariance
     matrix (taking  correlations instead of covariances for
     convenience).

     The model is identified by the proper priors on the subject
     abilities (ideal points) and item parameters.  The 'theta.fixed'
     solves the rotational invariance problem by constraining the
     sampler to one of the two identical posterior modes.  This
     function differs from the 'MCMCirtKd' function in the manner in
     which the model is identified and in the assumed priors.

_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:

     James H. Albert. 1992. ``Bayesian Estimation of Normal Ogive Item
     Response  Curves Using Gibbs Sampling." _Journal of Educational
     Statistics_.   17: 251-269.

     Joshua Clinton, Simon Jackman, and Douglas Rivers. 2000. ``The
     Statistical  Analysis of Legislative Behavior: A Unified
     Approach." Paper presented at  the Annual Meeting of the Political
     Methodology Society.

     Valen E. Johnson and James H. Albert. 1999. ``Ordinal Data
     Modeling."  Springer: New York.

     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:

     'plot.mcmc','summary.mcmc', 'MCMCirtKd'

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

        ## Not run: 
        data(SupremeCourt)
        posterior1 <- MCMCirt1d(SupremeCourt, burnin=10000, mcmc=50000)
        plot(posterior1)
        summary(posterior1)
        
        data(Senate)
        posterior2 <- MCMCirt1d(t(Senate[,6:677]), theta.fixed = 9,
           burnin=1000, mcmc=5000)
        plot(posterior2)
        summary(posterior2)
        
     ## End(Not run)

