Learn R Programming

pscl (version 0.5)

plot2d: Plots two dimensional summary of an ideal object

Description

Two dimensional scatterplots of estimated ideal points provided by an ideal object

Usage

plot2d(x, d1=1, d2=2, start=rownames(x$x)[1],
       overlayCuttingPlanes=FALSE, ...)

Arguments

x
an object of class ideal.
d1
integer, the number of the first dimension to plot. This dimension will appear on the horizontal (x) axis.
d2
integer, the number of the second dimension to plot. This dimension will appear on the vertical (y) axis.
start
the number of the iteration with which to begin when calculating the posterior mean and confidence interval.
overlayCuttingPlanes
logical, if TRUE, overlay the estimated bill-specific cutting planes
...
other parameters to be passed through to plotting functions.

Details

plot2d plots the posterior mean ideal points for each legislator in the first dimension against the ones for the second dimension. If party information is available (i.e., as a variable in the legis.data component of the rollcall object used to create the ideal object), legislators from different parties are plotted in different colors with different symbols.

The usual warning about identification applies a fortiori in the case of d > 1.

The overlayCuttingPlanes option will overlay estimates of the cutting planes separating the Yea position from the Nay position for each roll call. These planes correspond to the locus of points where legislators are estimated to be indifferent between a Yea vote and a Nay vote (n.b., for models with d > 1 dimensions, the location of the Yea and Nay alternatives are not identified, but the directions to those alternatives are identified, as is the hyperplane separating the Yea and Nay alternatives. In two dimensions, the cutting plane for rollcall vote j is a line with intercept .. and slope ..., with the estimated mean of the posterior densities for these parameters used to actually produce the plotted cutting line.

See Also

ideal, plot1d, plot.ideal

Examples

Run this code
data(s109)
cl2 <- constrain.legis(s109,
                       x=list("KENNEDY (D MA)"=c(-1,0),
                         "ENZI (R WY)"=c(1,0),
                         "CHAFEE (R RI)"=c(0,-.5)),
                       d=2)

## too long for examples
id2Constrained <- ideal(s109,
                        d=2,
                        priors=cl2,      ## priors (w constraints)
                        startvals=cl2,   ## start value (w constraints)
                        store.item=TRUE,
                        maxiter=5000,
                        burnin=500,
                        thin=25)
## short run for examples
id2Constrained <- ideal(s109,
                        d=2,
                        priors=cl2,      ## priors (w constraints)
                        startvals=cl2,   ## start value (w constraints)
                        store.item=TRUE,
                        maxiter=500,
                        burnin=100,
                        thin=10)
plot(id2Constrained)
plot(id2Constrained,
     overlayCuttingPlanes=TRUE)

Run the code above in your browser using DataLab