Learn R Programming

emIRT (version 0.0.14)

convertRC: Convert Roll Call Matrix Format

Description

convertRC takes a rollcall object and converts it into a format suitable for estimation with 'binIRT'.

Usage

convertRC(.rc, type = "binIRT")

Value

An object of class rollcall, with votes recoded such that yea=1, nay=-1, missing data = 0.

Arguments

.rc

a rollcall object containing votes to be scaled using 'binIRT'.

type

string, only ``binIRT'' is supported for now, and argument is ignored.

Author

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

'binIRT', 'makePriors', 'getStarts'.

Examples

Run this code

## 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]

Run the code above in your browser using DataLab