wnominate is the function that takes a rollcall object and estimates Poole
and Rosenthal W-NOMINATE scores with them.
wnominate(rcObject, ubeta=15, uweights=0.5, dims=2, minvotes=20, lop=0.025,trials=3, polarity, verbose=FALSE)rollcall, from Simon Jackman's pscl package. lop=0.025, eliminates votes where the minority is smaller
than 2.5
overwrites the lopsided attribute in the RC object inputted. c(3,5) indicates legislator 3 is conservative
on dimension 1, and legislator 5 is conservative on dimension 2.
Alternatively, polarity can be specified as a string for legislator names
found in legis.names (ie. c("Bush", "Gore")) if every legislative name in
the data set is unique. Finally, polarity can be specified as a list (ie.
list("cd",c(4,5))) where the first list item is a variable from the roll
call object's legis.data, and the second list item is a conservative
legislator on each dimension as specified by the first list item.
list("cd",c(4,5)) thus specifies the legislators with congressional
district numbers of 4 and 5. nomObject, which in this documentation is also referred to
as a W-NOMINATE object.nom31.dat file about
legislators. For a typical W-NOMINATE object run with an ORD file read using
readKH, it will contain the following:
stateState name of legislator.
icpsrStateICPSR state code of legislator.
cdCongressional District number.
icpsrLegisICPSR code of legislator.
partyParty of legislator.
partyCodeICPSR party code of legislator.
correctYeaPredicted Yeas and Actual Yeas.
wrongYeaPredicted Yeas and Actual Nays.
wrongNayPredicted Nays and Actual Yeas.
correctNayPredicted Nays and Actual Nays.
GMPGeometric Mean Probability.
CCCorrect Classification.
coord1DFirst dimension W-NOMINATE score, with all subsequent dimensions
numbered similarly.
se1DBootstrapped standard error of first dimension W-NOMINATE score,
with all subsequent dimensions numbered similarly. This will be
empty if trials is set below 4.
corr.1Covariance between first and second dimension W-NOMINATE score,
with all subsequent dimensions numbered similarly.
nom33.dat file about
bills. For a typical W-NOMINATE object run with an ORD file read
using readKH, it will contain the following:
correctYeaPredicted Yeas and Actual Yeas.
wrongYeaPredicted Yeas and Actual Nays.
wrongNayPredicted Nays and Actual Yeas.
correctNayPredicted Nays and Actual Nays.
GMPGeometric Mean Probability.
PREProportional Reduction In Error.
spread1DFirst dimension W-NOMINATE spread, with all subsequent dimensions
numbered similarly.
midpoint1DFirst dimension W-NOMINATE midpoint, with all subsequent dimensions
numbered similarly.
Keith Poole and Howard Rosenthal. 1997. 'Congress: A Political-Economic History of Roll Call Voting.' New York: Oxford University Press.
Keith Poole. http://voteview.ucsd.edu/
Keith Poole, Jeffrey Lewis, James Lo, and Royce Carroll. 2011. `Scaling Roll Call Votes with WNOMINATE in R.' Journal of Statistical Software, 42(14), 1-21. http://www.jstatsoft.org/v42/i14/
#This data file is the same as reading file using:
#sen90 <- readKH("ftp://voteview.com/sen90kh.ord")
#All ORD files can be found on www.voteview.com
data(sen90)
summary(sen90)
result<-wnominate(sen90,polarity=c(2,5))
#'result' is the same nomObject as found in
#data(sen90nomObject)
summary(result)
plot(result)
Run the code above in your browser using DataLab