Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.ideal

plots an ideal object


Description

Plot of the results of an ideal point estimation contained in an object of class ideal.

Usage

## S3 method for class 'ideal'
plot(x, conf.int=0.95, burnin=NULL, ...)

plot1d(x, d=1, conf.int=0.95, burnin=NULL,
       showAllNames = FALSE, ...)

plot2d(x, d1=1, d2=2, burnin=NULL,
       overlayCuttingPlanes=FALSE, ...)

Arguments

x

an object of class ideal

conf.int

for "ideal" objects with 1 dimension estimated, the level of the confidence interval to plot around the posterior mean for each legislator. If 2 or more dimensions were estimated, conf.int is ignored.

d

integer, which dimension to display in a 1d plot, if the object is a multidimensional ideal object

.

burnin

of the recorded MCMC samples, how many to discard as burnin? Default is NULL, in which case the value of burnin in the ideal object is used.

showAllNames

logical, if TRUE, the vertical axis will the names of all legislators. Default is FALSE to reduce clutter on typical-sized graph.

d1

integer, the number of the first dimension to plot when plotting multi-dimensional ideal objects. This dimension will appear on the horizontal (x) axis.

d2

integer, the number of the second dimension to plot when plotting multi-dimensional ideal objects. This dimension will appear on the vertical (y) axis.

overlayCuttingPlanes

logical, if TRUE, overlay the estimated bill-specific cutting planes

...

other parameters to be passed through to plotting functions.

Details

If the ideal object comes from fitting a d=1 dimensional model, then plot.ideal plots the mean of the posterior density over each legislator's ideal point, accompanied by a conf.int confidence interval. In this case, plot.ideal is simply a wrapper function to plot1d.

If the ideal object has d=2 dimensions, then plot2d is called, which plots the (estimated) mean of the posterior density of each legislator's ideal point (i.e., the ideal point/latent trait is a point in 2-dimensional Euclidean space, and the posterior density for each ideal point is a bivariate density). Single dimension summaries of the estimated ideal points (latent traits) can be obtained for multidimensional ideal objects by passing the ideal object directly to plot1d with d set appropriately.

If the ideal object has d>2 dimensions, a scatterplot matrix is produced via pairs, with the posterior means of the ideal points (latent traits) plotted against one another, dimension by dimension.

For unidimensional and two-dimensional models, if party information is available in the rollcall object contained in the ideal object, legislators from different parties are plotted in different colors. If the ideal object has more than 2 dimensions, plot.ideal() produces a matrix of plots of the mean ideal points of each dimension against the posterior mean ideal points of the other dimensions.

Note

When specifying a value of burnin different from that used in fitting the ideal object, note a distinction between the iteration numbers of the stored iterations, and the number of stored iterations. That is, the n-th iteration stored in an ideal object will not be iteration n if the user specified thin>1 in the call to ideal. Here, iterations are tagged with their iteration number. Thus, if the user called ideal with thin=10 and burnin=100 then the stored iterations are numbered 100, 110, 120, .... Any future subsetting via a burnin refers to this iteration number.

See Also

ideal; tracex for trace plots, a graphical aid useful in diagnosing convergence of the MCMC algorithms.

Examples

## Not run: 
data(s109)
id1 <- ideal(s109,
             d=1,
             normalize=TRUE,
             store.item=TRUE,
             maxiter=500,   ## short run for examples
             burnin=100,
             thin=10)  

plot(id1)


id2 <- ideal(s109,
             d=2,
             store.item=TRUE,
             maxiter=11e2,
             burnin=1e2,
             verbose=TRUE,
             thin=25)

plot(id2,overlayCuttingPlanes=TRUE)

id2pp <- postProcess(id2,
                     constraints=list(BOXER=c(-1,0),
                       INHOFE=c(1,0),
                       CHAFEE=c(0,.25)))

plot(id2pp,overlayCuttingPlanes=TRUE)

## End(Not run)

pscl

Political Science Computational Laboratory

v1.5.5
GPL-2
Authors
Simon Jackman, with contributions from Alex Tahk, Achim Zeileis, Christina Maimone, Jim Fearon and Zoe Meers
Initial release
2020-02-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.