legR: Multi-dimensional Independent Dynamic Item Response Theory

View source: R/legR.R

legRR Documentation

Multi-dimensional Independent Dynamic Item Response Theory

Description

Estimates the multi-dimensional dynamic IRT model.

Usage

legR(
  X,
  terms,
  est_model = FALSE,
  legis_data = NULL,
  priors = NULL,
  k = 5,
  ndim = 2,
  nperterm = NULL,
  bestmin = 0,
  othermax = 0,
  dynIRT_control = list(threads = 1, verbose = TRUE, thresh = 1e-06, maxit = 500),
  seed = 519,
  ...
)

Arguments

X

An n\times p matrix of votes with values 1, 0 or NA.

terms

A length p vector of values identifying the term in which the vote was taken. The first term should be coded as 1 and increase by consecutive integers.

est_model

Logical indicating whether model should be estimated. If FALSE, the initial latent variable is estimated, the pres calculated and the best dimension identified. A table is printed of the best dimension by term. In this case, just the PREs, best dimension and the data with lop-sided votes removed are returned.

legis_data

A data frame giving information about the legislators whose votes are in X. The only requirement is that the variable identifying the observations be called "name".

priors

User specified priors to be passed to the dynIRT function. Must be a list of priors of the same length as the dimensionality being estimated.

k

Number of dimensions for the GLRM to estimate.

ndim

Number of dimensions of the dynamic IRT model to be estimated.

nperterm

Minimum number of bills to include per term.

bestmin

Scalar indicating the minimum PRE value to be considered "well predicted" bythe model.

othermax

Scalar indicating the maximum PRE of the inferior dimension. If NULL, the algorithm just chooses the first highest PRE, regardless of the other PRE values.

dynIRT_control

A list containing control parameters for the dynamic IRT model. See the dynIRT documentation from the emIRT package.

seed

Random number generator seed passed down to estimation functions.

...

Other arguments to be passed down to init_lv, calc_pres, remove_lop.

Value

Depending on est_model either a list with the IRT inputs for evaluation purposes or a list of models and a dataset of latent variable estimates.


davidaarmstrong/legR documentation built on Oct. 13, 2023, 1:08 p.m.