simulateData {anominate} | R Documentation |
Simulated Roll Call Vote Matrices Generated with Normal (Gaussian) or Quadratic Utility for alpha-NOMINATE
Description
simulateData
generates a matrix of roll call votes based on the assumption that legislators possess either normal (Gaussian) or quadratic utility functions. The roll call votes can then be analyzed using the alpha-NOMINATE ideal point model. The estimated value of the alpha parameter can then be compared to the known true value (1 for normal (Gaussian) utility, 0 for quadratic utility).
Usage
simulateData(nvotes=500, nlegis=101, seed=123345, utility="normal")
Arguments
nvotes |
integer, number of roll call votes ('m'). |
nlegis |
integer, number of legislators ('n'). |
seed |
a single value, interpreted as an integer, used to set the seed. If seed is NULL, current seed is used. |
utility |
String set to either “normal” or “quadratic”, specifying the utility function used to generate the roll call data. |
Value
An object of class rollcall
votes |
n x m roll call vote matrix in 0/1/NA format. |
codes |
a list with named components |
n |
integer, number of legislators. |
m |
integer, number of roll call votes. |
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 roll call votes, set to NULL. |
desc |
user-supplied description, set to NULL. |
source |
user-supplied source information, set to NULL. |
Author(s)
Royce Carroll rcarroll@rice.edu
Christopher Hare cdhare@ucdavis.edu
Jeffrey B. Lewis jblewis@ucla.edu
James Lo lo@uni-mannheim.de
Keith T. Poole ktpoole@uga.edu
Howard Rosenthal hl31@nyu.edu
See Also
'anominate','summary.anominate','plot.anominate','densplot.anominate','traceplot.anominate', 'norm_anom', 'quad_anom','rollcall'.
Examples
quadratic.data <- simulateData(utility="quadratic")
quad_anom <- anominate(quadratic.data, dims=1, polarity=1,
nsamp=200, thin=1, burnin=100, random.starts=FALSE,
verbose=FALSE, constrain=FALSE)
# 'quad_anom' can be retrieved quickly with:
data(quad_anom)
summary(quad_anom)
plot(quad_anom)
normal.data <- simulateData(utility="normal")
norm_anom <- anominate(normal.data, dims=1, polarity=1,
nsamp=200, thin=1, burnin=100, random.starts=FALSE,
verbose=FALSE, constrain=FALSE)
# 'norm_anom' can be retrieved quickly with:
data(norm_anom)
summary(norm_anom)
plot(norm_anom)