Title: | Alpha-NOMINATE Ideal Point Estimator |
---|---|
Description: | Provides functions to estimate and interpret the alpha-NOMINATE ideal point model developed in Carroll et al. (2013, <doi:10.1111/ajps.12029>). alpha-NOMINATE extends traditional spatial voting frameworks by allowing for a mixture of Gaussian and quadratic utility functions, providing flexibility in modeling political actors' preferences. The package uses Markov Chain Monte Carlo (MCMC) methods for parameter estimation, supporting robust inference about individuals' ideological positions and the shape of their utility functions. It also contains functions to simulate data from the model and to calculate the probability of a vote passing given the ideal points of the legislators/voters and the estimated location of the choice alternatives. |
Authors: | Royce Carroll [aut], Christopher Hare [aut, cre], Jeffrey B. Lewis [aut], James Lo [aut], Keith T. Poole [aut], Howard Rosenthal [aut], Carlos Algara [aut], Samuel Fuller [aut] |
Maintainer: | Christopher Hare <[email protected]> |
License: | GPL-2 |
Version: | 0.7 |
Built: | 2024-11-23 17:21:57 UTC |
Source: | CRAN |
anominate
is the function that takes a rollcall
object and fits the Bayesian (MCMC-based) alpha-NOMINATE model described in Carroll et al. (2013). The method estimates the structure of political actors' utility functions from roll call data with the inclusion of a separate parameter denoted as alpha. alpha values of 1 indicate normal (Gaussian) utility, while alpha values of 0 indicate quadratic utility.
anominate(rcObject, dims=1, nsamp=1000, thin=1, burnin=500, minvotes=20, lop=0.025, polarity=1, random.starts=TRUE, verbose=FALSE, constrain=FALSE)
anominate(rcObject, dims=1, nsamp=1000, thin=1, burnin=500, minvotes=20, lop=0.025, polarity=1, random.starts=TRUE, verbose=FALSE, constrain=FALSE)
rcObject |
An object of class |
dims |
integer, number of dimensions to estimate. Must be nonnegative and cannot exceed 10 dimensions. |
nsamp |
interger, total number of iterations for the sampler. |
thin |
integer, thinning interval for the MCMC samples. |
burnin |
integer, number of iterations to be discarded. |
minvotes |
integer, minimum number of votes required for a legislator to be included in the analysis. |
lop |
A proportion between 0 and 1, the cut-off used for excluding lopsided
votes, expressed as the proportion of non-missing votes on the minority side.
The default, |
polarity |
a vector specifying the legislator in the data set who is conservative on
each dimension. For example, |
random.starts |
logical, indicating whether initial values for the legislator and bill parameters should be randomly drawn from a uniform distribution. If |
verbose |
logical, indicates whether the progress of W-NOMINATE and alpha-NOMINATE (at each 100th iteration of the MCMC sampler) should be printed to the screen. |
constrain |
logical, indicates whether alpha should be constrained to equal 1 rather than estimated. This option should be used if more than one dimension is being estimated, which makes the method equivalent to a Bayesian implementation of Poole and Rosenthal's (1997) NOMINATE model. |
An object of class anominate
, which in this documentation is also referred to
as an alpha-NOMINATE object.
alpha |
An object of class |
beta |
An object of class |
legislators |
A object of class |
yea.locations |
A object of class |
nay.locations |
A object of class |
wnom.result |
An object of class |
Royce Carroll [email protected]
Christopher Hare [email protected]
Jeffrey B. Lewis [email protected]
James Lo [email protected]
Keith T. Poole [email protected]
Howard Rosenthal [email protected]
Royce Carroll, Jeffrey B. Lewis, James Lo, Keith T. Poole and Howard Rosenthal. 2013. “The Structure of Utility in Spatial Models of Voting.”' American Journal of Political Science 57(4): 1008-1028.
Jeffrey B. Lewis. https://voteview.com/
Keith Poole and Howard Rosenthal. 1997. Congress: A Political-Economic History of Roll Call Voting. New York: Oxford University Press.
'summary.anominate','plot.anominate','densplot.anominate','traceplot.anominate','simulateData', 'sen111', 'sen111_anom', 'rollcall'.
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) # Summary statistics: summary(sen111_anom) # Graphical summaries: plot(sen111_anom) densplot.anominate(sen111_anom) traceplot.anominate(sen111_anom)
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) # Summary statistics: summary(sen111_anom) # Graphical summaries: plot(sen111_anom) densplot.anominate(sen111_anom) traceplot.anominate(sen111_anom)
densplot.anominate
reads an anominate
object and plots the density of sampled values of the alpha parameter using the densplot
function in coda
.
## S3 method for class 'anominate' densplot(x, ...)
## S3 method for class 'anominate' densplot(x, ...)
x |
An |
... |
Other arguments to |
A density plot of sampled values of alpha.
Royce Carroll [email protected]
Christopher Hare [email protected]
Jeffrey B. Lewis [email protected]
James Lo [email protected]
Keith T. Poole [email protected]
Howard Rosenthal [email protected]
'anominate','summary.anominate','plot.anominate','traceplot.anominate','sen111', 'sen111_anom'.
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) summary(sen111_anom) densplot.anominate(sen111_anom)
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) summary(sen111_anom) densplot.anominate(sen111_anom)
An object of class anominate
that contains the estimated alpha-NOMINATE result for data simulated using normal (Gaussian) utility. Although it can easily be obtained from calling the example in simulateData
, it is included here to facilitate illustration of the examples for the plot and summary functions.
data(norm_anom)
data(norm_anom)
An object of class anominate
, which in this documentation is also referred to
as an alpha-NOMINATE object.
alpha |
An object of class |
beta |
An object of class |
legislators |
A object of class |
yea.locations |
A object of class |
nay.locations |
A object of class |
wnom.result |
An object of class |
Royce Carroll [email protected]
Christopher Hare [email protected]
Jeffrey B. Lewis [email protected]
James Lo [email protected]
Keith T. Poole [email protected]
Howard Rosenthal [email protected]
'anominate','simulateData','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)
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)
plot.anominate
reads an anominate
object and plots the estimated ideal points.
## S3 method for class 'anominate' plot(x, ...)
## S3 method for class 'anominate' plot(x, ...)
x |
An |
... |
Other arguments do nothing and are not passed to any functions. |
A coordinate plot of estimated ideal points (with 95% credible interval bars) of an anominate
object.
Royce Carroll [email protected]
Christopher Hare [email protected]
Jeffrey B. Lewis [email protected]
James Lo [email protected]
Keith T. Poole [email protected]
Howard Rosenthal [email protected]
'anominate','summary.anominate','densplot.anominate','traceplot.anominate','sen111', 'sen111_anom'.
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) plot(sen111_anom)
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) plot(sen111_anom)
An object of class anominate
that contains the estimated alpha-NOMINATE result for data simulated using quadratic utility. Although it can easily be obtained from calling the example in simulateData
, it is included here to facilitate illustration of the examples for the plot and summary functions.
data(quad_anom)
data(quad_anom)
An object of class anominate
, which in this documentation is also referred to
as an alpha-NOMINATE object.
alpha |
An object of class |
beta |
An object of class |
legislators |
A object of class |
yea.locations |
A object of class |
nay.locations |
A object of class |
wnom.result |
An object of class |
Royce Carroll [email protected]
Christopher Hare [email protected]
Jeffrey B. Lewis [email protected]
James Lo [email protected]
Keith T. Poole [email protected]
Howard Rosenthal [email protected]
'anominate','simulateData','norm_anom'.
quadrartic.data <- simulateData(utility="quadratic") quad_anom <- anominate(quadrartic.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)
quadrartic.data <- simulateData(utility="quadratic") quad_anom <- anominate(quadrartic.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)
This dataframe contains a matrix of votes cast by U.S. Senators
in the 111th Congress. The data are formatted consistent with the
rollcall
object format in Simon Jackman's pscl
package.
data(sen111)
data(sen111)
The dataframe contains roll call data for all Senators in the 111th Senate.
The data is formatted as a rollcall
object with the following elements.
votes |
data frame, containing all data from the old
|
codes |
list of four vectors. |
n |
numeric, number of legislators |
m |
numeric, number of roll calls |
legis.data |
data frame, containing the following information on legislators:
|
vote.data |
null, would otherwise be a data frame containing data on the votes. |
desc |
null, would otherwise be a string describing the data set. |
source |
string, describing where data set was read from. |
Royce Carroll [email protected]
Christopher Hare [email protected]
Jeffrey B. Lewis [email protected]
James Lo [email protected]
Keith T. Poole [email protected]
Howard Rosenthal [email protected]
Keith Poole. 2014. 111th Senate Roll Call Vote Data. https://www.voteview.com/.
'anominate'.
data(sen111) summary(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) summary(sen111_anom) plot(sen111_anom)
data(sen111) summary(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) summary(sen111_anom) plot(sen111_anom)
An object of class anominate
that contains the estimated alpha-NOMINATE result for the 111th U.S Senate (in one dimensions). Although it can easily be obtained from calling the example in anominate
, it is included here to facilitate illustration of the examples for the plot and summary functions.
data(sen111_anom)
data(sen111_anom)
An object of class anominate
, which in this documentation is also referred to
as an alpha-NOMINATE object.
alpha |
An object of class |
beta |
An object of class |
legislators |
A object of class |
yea.locations |
A object of class |
nay.locations |
A object of class |
wnom.result |
An object of class |
Royce Carroll [email protected]
Christopher Hare [email protected]
Jeffrey B. Lewis [email protected]
James Lo [email protected]
Keith T. Poole [email protected]
Howard Rosenthal [email protected]
'anominate'.
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) summary(sen111_anom) plot(sen111_anom)
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) summary(sen111_anom) plot(sen111_anom)
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).
simulateData(nvotes=500, nlegis=101, seed=123345, utility="normal")
simulateData(nvotes=500, nlegis=101, seed=123345, utility="normal")
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. |
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. |
Royce Carroll [email protected]
Christopher Hare [email protected]
Jeffrey B. Lewis [email protected]
James Lo [email protected]
Keith T. Poole [email protected]
Howard Rosenthal [email protected]
'anominate','summary.anominate','plot.anominate','densplot.anominate','traceplot.anominate', 'norm_anom', 'quad_anom','rollcall'.
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)
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)
summary.anominate
reads an anominate
object and prints a summary.
## S3 method for class 'anominate' summary(object, ...)
## S3 method for class 'anominate' summary(object, ...)
object |
An |
... |
Other arguments do nothing and are not passed to any functions. |
A summary of an anominate
object. Reports the number of legislators, votes, dimensions, and descriptive statistics for alpha.
Royce Carroll [email protected]
Christopher Hare [email protected]
Jeffrey B. Lewis [email protected]
James Lo [email protected]
Keith T. Poole [email protected]
Howard Rosenthal [email protected]
'anominate','plot.anominate','densplot.anominate','traceplot.anominate'.
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) summary(sen111_anom)
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) summary(sen111_anom)
traceplot.anominate
reads an object and plots the density of sampled values of the alpha parameter using the traceplot
function in coda
.
## S3 method for class 'anominate' traceplot(x, ...)
## S3 method for class 'anominate' traceplot(x, ...)
x |
An |
... |
Other arguments to |
A trace plot of sampled values of alpha.
Royce Carroll [email protected]
Christopher Hare [email protected]
Jeffrey B. Lewis [email protected]
James Lo [email protected]
Keith T. Poole [email protected]
Howard Rosenthal [email protected]
'anominate','summary.anominate','plot.anominate','densplot.anominate','sen111', 'sen111_anom'.
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) summary(sen111_anom) traceplot.anominate(sen111_anom)
data(sen111) sen111_anom <- anominate(sen111, dims=1, polarity=2, nsamp=200, thin=1, burnin=100, random.starts=FALSE, verbose=FALSE, constrain=FALSE) # 'sen111_anom' can be retrieved quickly with: data(sen111_anom) summary(sen111_anom) traceplot.anominate(sen111_anom)