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.
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, ... )
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 \times J)$. We assume that the choice is
dictated by an unobserved utility: $$z_{i,j} = \alpha_i +
\beta_i \theta_j + \varepsilon_{i,j}$$ 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 \sim \mathcal{N}(t_{0,j},T_{0,j})$$
Note that this implies a separate prior mean and variance for each
subject. For the item parameters, the prior is:
$$\left[\alpha_i, \beta_i \right]' \sim \mathcal{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.
Andrew D. Martin, Kevin M. Quinn, and Daniel Pemstein. 2003.
Scythe Statistical Library 0.4.
plot.mcmc
,summary.mcmc
,
MCMCirtKd
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)
Run the code above in your browser using DataLab