poisIRT {emIRT} | R Documentation |
Poisson IRT estimation via EM
Description
poisIRT
estimates an IRT model with count (usually word counts) in cells. Estimation
is conducted using the EM algorithm described in the reference paper below. The algorithm
generalizes a model by Slapin and Proksch (2009) that is commonly applied to manifesto
data.
Usage
poisIRT(.rc, i = 0:(nrow(.rc)-1), NI = nrow(.rc), .starts = NULL, .priors = NULL,
.control = NULL)
Arguments
.rc |
matrix, usually with unique words along the J rows and different documents across K columns. Each cell will contain a count of words. There should be no NA values, so documents missing a particular word should list 0 in the cell. |
i |
vector of length K, indicating for each of the K documents which actor it belongs to. Assignment of actors begins at actor 0. If set to 0:(K-1), and NI=K below, then each document is assigned its own ideal point, and we get the Slapin and Proksch Wordfish model. |
NI |
integer, number of unique actors. Must be less than or equal to K. If NI=K, then each document is assigned its own ideal point, and we get the Slapin and Proksch Wordfish model. |
.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:
|
.control |
list, specifying some control functions for estimation. Options include the following:
|
Value
An object of class poisIRT
.
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:
|
N |
A list of sizes, with elements listed as follow:
|
i_of_k |
A copy of input for argument ‘i’, which allows the J documents to be linked to I actors. |
Author(s)
Kosuke Imai imai@harvard.edu
James Lo jameslo@princeton.edu
Jonathan Olmsted jpolmsted@gmail.com
References
Kosuke Imai, James Lo, and Jonathan Olmsted (2016). “Fast Estimation of Ideal Points with Massive Data.” American Political Science Review, Vol. 110, No. 4 (December), pp. 631-656.
See Also
Examples
## Not run:
## Load German Manifesto data
data(manifesto)
## Estimate variational Wordfish model
lout <- poisIRT(.rc = manifesto$data.manif,
i = 0:(ncol(manifesto$data.manif)-1),
NI=ncol(manifesto$data.manif),
.starts = manifesto$starts.manif,
.priors = manifesto$priors.manif,
.control = {list(
threads = 1,
verbose = TRUE,
thresh = 1e-6,
maxit=1000
)})
## Positional Estimates for Parties
lout$means$x
## End(Not run)