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.
generateTestData(legislators=20, rcVotes=100,
yea=matrix(runif(rcVotes,min=-0.2,max=0.7),nrow=rcVotes),
nay=matrix(runif(rcVotes,min=-0.7,max=0.2),nrow=rcVotes),
ideal=matrix(rnorm(legislators),nrow=legislators),
Beta=15, dimweight=0.5,normal=1, seed = NULL, utility='nominate')
An object of class rollcall
n x m vote matrix in 0/1/NA format.
integer, number of legislators.
integer, number of roll call votes.
logical vector of length m
indicating dropped vote. This is
recomputed in wnominate
and is never used.
matrix, user-supplied data on legislators, containing data from an ORD file. Legislator names are rownames to this matrix.
user-supplied data on rollcall votes, set to NULL.
user-supplied description, set to NULL.
integer, number of Legislators ('n').
integer, number of roll calls ('m').
an m x d matrix of yea locations, where 'd' are the number of dimensions.
an m x d matrix of no locations, where 'd' are the number of dimensions.
an n x d matrix of legislator ideal points.
scalar giving beta parameter from W-NOMINATE.
d x 1 vector of dimension weights.
integer, '1' generates data using normal probabilities, any other value generates data using logistic probabilities.
a single value, interpreted as an integer, used to set the seed. If seed is NULL, current seed is used.
String set to either ``nominate'' or ``qn''. `nominate' allows NOMINATE logit or probit utilities, while ``qn'' allows for quadratic normal utilities to be used when generating the roll call matrix.
Keith Poole ktpoole@uga.edu
Jeffrey Lewis jblewis@ucla.edu
James Lo lojames@usc.edu
Royce Carroll rcarroll@rice.edu
'wnominate', 'nomprob'.
dat<-generateTestData()
result<-wnominate(dat,polarity=c(1,2))
summary(result)
plot(result)
Run the code above in your browser using DataLab