binIRT {emIRT} | R Documentation |
Two-parameter Binary IRT estimation via EM
Description
binaryIRT
estimates a binary IRT model with two response categories. Estimation
is conducted using the EM algorithm described in the reference paper below. The algorithm will
produce point estimates that are comparable to those of ideal
,
but will do so much more rapidly and also scale better with larger data sets.
Usage
binIRT(.rc, .starts = NULL, .priors = NULL, .D = 1L, .control = NULL,
.anchor_subject = NULL, .anchor_outcomes = FALSE)
Arguments
.rc |
a list object, in which .rc$votes is a matrix of numeric values containing the data to be scaled. Respondents are assumed to be on rows, and items assumed to be on columns, so the matrix is assumed to be of dimension (N x J). For each item, ‘1’, and ‘-1’ represent different responses (i.e. yes or no votes) with ‘0’ as a missing data record. |
.starts |
a list containing several matrices of starting values for the parameters. The list should contain the following matrices:
|
.priors |
list, containing several matrices of starting values for the parameters. The list should contain the following matrices:
|
.D |
integer, indicates number of dimensions to estimate. Only a
1 dimension is currently supported. If a higher dimensional model is
requested, |
.control |
list, specifying some control functions for estimation. Options include the following:
|
.anchor_subject |
integer, the index of the subect to be used in
anchoring the orientation/polarity of the underlying latent
dimensions. Defaults to |
.anchor_outcomes |
logical, should an outcomes-based metric be
used to anchor the orientation of the underlying space. The
outcomes-based anchoring uses a model-free/non-parametric
approximation to quantify each item's difficulty and each subject's
ability. The post-processing then rotates the model-dependent results
to match the model-free polarity. Defaults to |
Value
An object of class binIRT
.
means |
list, containing several matrices of point estimates for the parameters corresponding to the inputs for the priors. The list should contain the following matrices.
|
vars |
list, containing several matrices of variance estimates for parameters corresponding to the inputs for the priors. Note that these variances are those recovered via variational approximation, and in most cases they are known to be far too small and generally unusable. Better estimates of variances can be obtained manually via the parametric bootstrap. The list should contain the following matrices:
|
runtime |
A list of fit results, with elements listed as follows: |
iters
integer, number of iterations run.
conv
integer, convergence flag. Will return 1 if threshold reached, and 0 if maximum number of iterations reached.
threads
integer, number of threads used to estimated model.
tolerance
numeric, tolerance threshold for convergence. Identical to thresh argument in input to .control list.
n |
Number of respondents in estimation, should correspond to number of rows in roll call matrix. |
j |
Number of items in estimation, should correspond to number of columns in roll call matrix. |
d |
Number of dimensions in estimation. |
call |
Function call used to generate output. |
Author(s)
Kosuke Imai imai@harvard.edu
James Lo lojames@usc.edu
Jonathan Olmsted jpolmsted@gmail.com
References
Kosuke Imai, James Lo, and Jonathan Olmsted “Fast Estimation of Ideal Points with Massive Data.” Working Paper. American Political Science Review, Vol. 110, No. 4 (December), pp. 631-656.
See Also
'convertRC', 'makePriors', 'getStarts'.
Examples
## Data from 109th US Senate
data(s109)
## Convert data and make starts/priors for estimation
rc <- convertRC(s109)
p <- makePriors(rc$n, rc$m, 1)
s <- getStarts(rc$n, rc$m, 1)
## Conduct estimates
lout <- binIRT(.rc = rc,
.starts = s,
.priors = p,
.control = {
list(threads = 1,
verbose = FALSE,
thresh = 1e-6
)
}
)
## Look at first 10 ideal point estimates
lout$means$x[1:10]
lout2 <- binIRT(.rc = rc,
.starts = s,
.priors = p,
.control = {
list(threads = 1,
verbose = FALSE,
thresh = 1e-6
)
},
.anchor_subject = 2
)
# Rotates so that Sen. Sessions (R AL)
# has more of the estimated trait
lout3 <- binIRT(.rc = rc,
.starts = s,
.priors = p,
.control = {
list(threads = 1,
verbose = FALSE,
thresh = 1e-6
)
},
.anchor_subject = 10
)
# Rotates so that Sen. Boxer (D CA)
# has more of the estimated trait
cor(lout2$means$x[, 1],
lout3$means$x[, 1]
)
# = -1 --> same numbers, flipped
# orientation