makePriors: Generate Priors for 'binIRT'

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/makePriors.R

Description

makePriors generates diffuse priors for binIRT.

Usage

1
  makePriors(.N = 20, .J = 100, .D = 1)

Arguments

.N

integer, number of subjects/legislators to generate priors for.

.J

integer, number of items/bills to generate priors for.

.D

integer, number of dimensions.

Value

Author(s)

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', 'getStarts', 'convertRC'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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]

kosukeimai/emIRT documentation built on Feb. 19, 2022, 7:14 p.m.