binIRT: Two-parameter Binary IRT estimation via EM

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/binIRT.R

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

1
  binIRT(.rc, .starts = NULL, .priors = NULL, .D = 1L, .control = NULL) 

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:

  • alpha A (J x 1) matrix of starting values for the item difficulty parameter alpha.

  • beta A (J x D) matrix of starting values for the item discrimination parameter β.

  • x An (N x D) matrix of starting values for the respondent ideal points x_i.

.priors

list, containing several matrices of starting values for the parameters. The list should contain the following matrices:

  • x$mu A (D x D) prior means matrix for respondent ideal points x_i.

  • x$sigma A (D x D) prior covariance matrix for respondent ideal points x_i.

  • beta$mu A ( D+1 x 1) prior means matrix for α_j and β_j.

  • beta$sigma A ( D+1 x D+1 ) prior covariance matrix for α_j and β_j.

.D

integer, indicates number of dimensions to estimate.

.control

list, specifying some control functions for estimation. Options include the following:

  • threads integer, indicating number of cores to use. Default is to use a single core, but more can be supported if more speed is desired.

  • verbose boolean, indicating whether output during estimation should be verbose or not. Set FALSE by default.

  • thresh numeric. Algorithm will run until all parameters correlate at 1 - thresh across consecutive iterations. Set at 1e-6 by default.

  • maxit integer. Sets the maximum number of iterations the algorithm can run. Set at 500 by default.

  • checkfreq integer. Sets frequency of verbose output by number of iterations. Set at 50 by default.

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.

  • x A (N x 1) matrix of point estimates for the respondent ideal points x_i.

  • beta A (J x D+1 ) matrix of point estimates for the item parameters α and β.

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:

  • x A (N x 1) matrix of variances for the respondent ideal points x_i.

  • beta A (J x D+1 ) matrix of variances for the item parameters α and β.

runtime

A list of fit results, with elements listed as follows:

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 kimai@princeton.edu

James Lo jameslo@princeton.edu

Jonathan Olmsted jpolmsted@gmail.com

References

Kosuke Imai, James Lo, and Jonathan Olmsted “Fast Estimation of Ideal Points with Massive Data.” Working Paper. Available at http://imai.princeton.edu/research/fastideal.html.

See Also

'convertRC', 'makePriors', 'getStarts'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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]

HJ08003/HJemIRT documentation built on May 6, 2019, 9:47 p.m.