rollcall
data via the spatial voting model;
analagous to fitting educational testing data via an item-response
model. Model fitting via Markov chain Monte Carlo (MCMC).ideal(object, codes = object$codes,
dropList = list(codes = "notInLegis", lop = 0),
d = 1, maxiter = 10000, thin = 100, burnin = 5000,
impute = FALSE, meanzero = FALSE,
priors = NULL, startvals = NULL,
store.item = FALSE, file = NULL)
rollcall
thin
burnin
will be recorded. Must be a
multiple of thin
.logical
, whether to treat missing entries
of the rollcall matrix as missing at random, sampling from the
predictive density of the missing entries at each MCMC iteration.logical
, whether estimated ideal points
should have a mean of zero and standard deviation one. If TRUE
,
any user-supplied priors will be ignored. This option is helpful
for unidimlist
of parameters (means and variances)
specifying normal priors for the legislators' ideal points. The
default is NULL
, in which case prior values will be generated
for both legislators' ideal points and roll calllist
containing start values for
legislators' ideal points and item parameters. Default is
NULL
, in which case start values will be generated for both
legislators' ideal points and item parameters. See Details. Iflogical
, whether item discrimination
parameters should be stored. Storing item discrimination parameters
can consume a large amount of memory.NULL
, in which case MCMC output is stored in memory.
Note that post-estimation commands like plot
will not
work unless MCMC output is stored in memory.list
of class ideal
with named componentsn
numeric
, integer, number of legislators in the
analysis, after any subseting via entries of dropList
).m
numeric
, integer, number of rollcalls in roll
call matrix, after any subseting via entries of dropList
.d
numeric
, integer, number of dimensions
fitted.x
matrix
containing the MCMC samples for
the ideal point of each legislator in each dimension for each
iteration from burnin
to maxiter
, at an interval of
thin
. Rows of the x
matrix index iterations; columns
index legislators.beta
matrix
containing the MCMC samples
for the item discrimination parameter for each item in each
dimension, plus an intercept, for each iteration from burnin
to maxiter
, at an interval of thin
. Rows of the
beta
matrix index MCMC iterations; columns index parameters.xbar
matrix
containing the means of the
MCMC samples for the ideal point of each legislator in each dimension,
using iterations burnin
to maxiter
, at an interval of
thin
; i.e., the column means of x
.betabar
matrix
containing the means of
the MCMC samples for the vote-specific parameters, using iterations
burnin
to maxiter
, at an interval of thin
;
i.e., the column means of beta
.call
call
, containing
the arguments passed to ideal
as unevaluated expressions.d
+1 parameter item-response model to
the roll call data object, so in one dimension the model reduces
to the two-parameter item-response model popular in educational testing.
See References.
Identification: The model parameters are not
identified without the user supplying some restrictions on the
model parameters (translations, rotations and re-scalings of the
ideal points are observationally equivalent, via offsetting
transformations of the item parameters). It is the user's
responsibility to impose these restrictions. For one-dimensional
models, a simple route to identification is the meanzero
option, which guarantees local identification (identification
up to a 180 rotation of the recovered dimension); spike priors
(priors with arbitrarily large precisions) or the
constrain.legis
option on any two legislators' ideal points
global identification. In higher dimensions identification can be obtained by supplying fixed
values for d+1
legislators' ideal points, provided the supplied
points span a d
-dimensional space (e.g., three supplied ideal
points form a triangle in d=2
dimensions), via the
contrain.legis
option. In this case the function defaults to vague
normal priors, but at each iteration the sampled ideal points are
transformed back into the space of identified parameters, applying the
linear transformation that maps the d+1
fixed ideal points
from their sampled values to their fixed values.
Alternatively, one can impose restrictions on the item parameters via
constrain.items
.
Start values. Start values can be supplied by the user, or
generated by the function itself.
constrain.legis
or
constrain.items
use the same procedures discussed
below, but also impose any (identifying) constraints imposed by the user.
Start values for legislators'
ideal points are generated by double-centering the
roll call matrix (subtracting row means, and column means, adding in
the grand mean), forming a correlation matrix across legislators, and
extracting the first d
eigenvectors, scaled by the square root
of the corresponding eigenvalues. Any constraints from
constrain.legis
are then considered, with the
unconstrained start values (linearly) transformed via least squares
regression (minimizing the sum of the squared differences between the
constrained and the unconstrained start values.
To generate start values for the rollcall/item parameters, a series of
binomial
glm
s are estimated (with
a probit link
), one for each rollcall/item,
$j = 1, \ldots, m$. The votes on the $j$-th rollcall/item are a
binary response, and the (constrained or unconstrained) start values
for legislators are predictors; the estimated coefficients are stored
to serve as start values for the item discrimination and difficulty
parameters. Any constraints on particular item discrimination parameters
from constrain.legis
are then imposed.
Clinton, Joshua, Simon Jackman and Douglas Rivers. 2004. "The Statistical Analysis of Roll Call Data" American Political Science Review. 98:335-370.
Patz, Richard J. and Brian W. Junker. 1999. "A Straightforward Approach to Markov Chain Monte Carlo Methods for Item Response Models." Journal of Education and Behavioral Statistics. 24:146-178. Rivers, Douglas. 2003. "Identification of Multidimensional Item-Response Models." Typescript. Department of Political Science, Stanford University.
rollcall
, summary.ideal
,
plot.ideal
, predict.ideal
.
tracex
for graphical display of MCMC iterative
history. idealToMCMC
converts the MCMC iterates in an
ideal
object to a form that can be used by the coda
library.
constrain.items
and
constrain.legis
for implementing identfying
restrictions.
MCMCirt1d
and
MCMCirtKd
in the MCMCpack
package provide similar functionality to ideal
.
data(s109)
## short run for examples
id1 <- ideal(s109,
d=1,
meanzero=TRUE,
store.item=TRUE,
maxiter=1000,
burnin=100,
thin=10)
summary(id1)
## more realistic long run
idLong <- ideal(s109,
d=1,
meanzero=TRUE,
store.item=TRUE,
maxiter=251e3,
burnin=1000,
thin=1e3)
Run the code above in your browser using DataLab