Description Usage Arguments Value Author(s) References See Also Examples
hierIRT
estimates an hierarchical IRT model with two response categories, allowing the use of covariates
to help determine ideal point estimates. Estimation is conducted using the variational EM algorithm described
in the reference paper below. A special case of this model occurs when time/session is used as the covariate —
this allows legislator ideal points to vary over time with a parametric time trend. Notably, the popular
DWNOMINATE model (Poole and Rosenthal, 1997) is one such example, in which legislator ideal points shift
by a constant amount each period, and the error term in the hierarchical model is set to 0. In contrast to
other functions in this package, this model does not assume a ‘rectangular’ roll call matrix, and all data
are stored in vector form.
1 
.data 
a list with the following items:

.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:

An object of class hierIRT
.
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 several parameters of interest for diagnostic purposes. 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. 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 
A list of counts of various items: 
D
integer, number of dimensions (i.e. number of covariates, including intercept).
G
integer, number of groups.
I
integer, number of ideal points.
J
integer, number of items/bill parameters.
L
integer, number of observed votes.
call 
Function call used to generate output. 
Kosuke Imai [email protected]
James Lo [email protected]
Jonathan Olmsted [email protected]
Variational model is described in 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.
'dwnom'.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35  ### Real data example of US Senate 80110 (not run)
### Based on voteview.com example of DWNOMINATE (ftp://voteview.com/dwnominate.htm)
### We estimate a hierarchical model without noise and a linear time covariate
### This model corresponds very closely to the DWNOMINATE model
## Not run:
data(dwnom)
## This takes about 10 minutes to run on 8 threads
## You may need to reduce threads depending on what your machine can support
lout < hierIRT(.data = dwnom$data.in,
.starts = dwnom$cur,
.priors = dwnom$priors,
.control = {list(
threads = 8,
verbose = TRUE,
thresh = 1e4,
maxit=200,
checkfreq=1
)})
## Bind ideal point estimates back to legislator data
final < cbind(dwnom$legis, idealpt.hier=lout$means$x_implied)
## These are estimates from DWNOMINATE as given on the Voteview example
## From file "SL80110C21.DAT"
nomres < dwnom$nomres
## Merge the DWNOMINATE estimates to model results by legislator ID
## Check correlation between hierIRT() and DWNOMINATE scores
res < merge(final, nomres, by=c("senate","id"),all.x=TRUE,all.y=FALSE)
cor(res$idealpt.hier, res$dwnom1d)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.