View source: R/predict.ideal.r
plot.predict.ideal | R Documentation |
Plot classification success rates by legislators, or by roll calls, using predictions from ideal.
## S3 method for class 'predict.ideal'
plot(x, type = c("legis", "votes"),...)
x |
an object of class |
type |
string; one of |
... |
further arguments passed to or from other methods. |
type="legis"
produces a plot of the “percent correctly
predicted” for each legislator/subject
(using the classification threshold set in
predict.ideal
) against the estimated ideal point of each
legislator/subject (the estimated mean of the posterior density of the
ideal point), dimension at
a time. If the legislators' party affiliations are available in the
rollcall
object that was passed to ideal
,
then legislators from the same party are plotted with a unique color.
type="votes"
produces a plot of classification rates for each
roll call, by the percentage of legislators voting for the losing
side. The x
-ordinate is jittered for clarity.
After drawing plots on the current device, exits silently returning invisible(NULL)
.
Simon Jackman simon.jackman@sydney.edu.au
predict.ideal
ideal
data(s109)
f = system.file("extdata","id1.rda",package="pscl")
load(f)
phat <- predict(id1)
plot(phat,type="legis")
plot(phat,type="votes")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.