generateTestData {wnominate}R Documentation

Test Data Generator for W-NOMINATE

Description

generateTestData is the function that generates a rollcall object used to test wnominate. The description of the result below is copied from the documentation of package pscl, written by Simon Jackman.

Usage

generateTestData(legislators=20, rcVotes=100,
            yea=matrix(runif(rcVotes,max=0.3),nrow=rcVotes),
            nay=matrix(runif(rcVotes,max=0.3),nrow=rcVotes),
            ideal=matrix(rnorm(legislators),nrow=legislators),
            Beta=15, dimweight=0.5,normal=1)                         

Arguments

legislators integer, number of Legislators ('n').
rcVotes integer, number of roll calls ('m').
yea an m x d matrix of yea locations, where 'd' are the number of dimensions.
nay an m x d matrix of no locations, where 'd' are the number of dimensions.
ideal an n x d matrix of legislator ideal points.
Beta scalar giving beta parameter from W-NOMINATE.
dimweight d x 1 vector of dimension weights.
normal integer, '1' generates data using normal probabilities, any other value generates data using logistic probabilities.

Value

An object of class rollcall

votes n x m vote matrix in 0/1/NA format.
n integer, number of legislators.
m integer, number of roll call votes.
lopsided logical vector of length m indicating dropped vote. This is recomputed in wnominate and is never used.
legis.data matrix, user-supplied data on legislators, containing data from an ORD file. Legislator names are rownames to this matrix.
vote.data user-supplied data on rollcall votes, set to NULL.
desc user-supplied description, set to NULL.

Author(s)

Keith Poole kpoole@ucsd.edu

Jeffrey Lewis jblewis@ucla.edu

James Lo jameslo@ucla.edu

Royce Carroll rcarroll@ucsd.edu

See Also

'wnominate', 'nomprob'.

Examples

    dat<-generateTestData()
    result<-wnominate(dat,polarity=c(1,2))
    summary(result)
    plot(result)

[Package wnominate version 0.91 Index]