Learn R Programming

pscl (version 0.5)

readKH: Read Roll Call Data from Poole-Rosenthal KH format

Description

Creates a rollcall object from the flat file format used by Keith Poole and Howard Rosenthal

Usage

readKH(file,
       dtl=NULL,
       yea=c(1,2,3),
       nay=c(4,5,6),
       missing=c(7,8,9),
       notInLegis=0,
       desc=NULL,
       debug=FALSE)

Arguments

file
string, name of a file or URL holding KH data
dtl
string, name of a file or URL holding KH dtl file (information about votes); default is NULL, indicating no dtl file
yea
numeric, possibly a vector, code(s) for a Yea vote in the rollcall context (or a correct answer in the educational testing context). Default is c(1,2,3), which corresponds to Yea, Paired Yea, and Announced Yea in Poole/Rosenthal d
nay
numeric, possibly a vector, code(s) for a Nay vote in the rollcall context (or an incorrect answer in the educational testing context). Default is c(4,5,6), which corresponds to Announced Nay, Paired Nay, and Nay in Poole/Rosenth
missing
numeric and/or NA, possible a vector, code(s) for missing data. Default is c(0,7,8,9,NA); the first four codes correspond to Not Yet a Member, Present (some Congresses), Present (some Congresses), and Not Voting.
notInLegis
numeric or NA, possibly a vector, code(s) for the legislator not being in the legislature when a particular roll call was recorded (e.g., deceased, retired, yet to be elected). Default is 0 for Poole/Rosenthal data fi
desc
string, describing the data, e.g., 82nd U.S. House of Representatives; default is NULL
debug
logical, print debugging information for net connection

Value

  • an object of class rollcall, with components created using the identifying information in the Poole/Rosenthal files. If the function can not read the file (e.g., the user specified a URL and the machine is not connected to the Internet), the function fails with an error message (set debug=TRUE to help resolve these issues).

code

dtl

itemize

  • date

item

  • icpsrState
  • cd
  • icpsrLegis
  • partyName
  • party
  • description

url

  • http://voteview.com/icpsr.htm
  • http://voteview.com/party3.dat
  • ftp://pooleandrosenthal/dtl/102s.dtl

Details

Keith Poole and Howard Rosenthal have gathered an impressive collection of roll call data, spanning every roll call cast in the United States Congress. This effort continues now as a real-time exercise, via a collaboration with Jeff Lewis (109th Congress onwards). Nolan McCarty collaborated on the compilation of roll call data for the 102nd through 108th Congress.

This function relies on some hard-coded features of Poole-Rosenthal flat files, and assumes that the file being supplied has the following structure (variable, start-end columns):

  • ICPSR legislator unique ID
{4-8} ICPSR state ID{9-10} Congressional District{11-12} state name{13-20} party code{21-23} legislator name{26-36} roll-call voting record{37 to end-of-record}

References

Poole, Keith and Howard Rosenthal. 1997. Congress: A Political-Economic History of Roll Call Voting. New York: Oxford University Press.

Poole, Keith. http://voteview.ucsd.edu

Rosenthal, Howard L. and Keith T. Poole. United States Congressional Roll Call Voting Records, 1789-1990: Reformatted Data [computer file]. 2nd ICPSR release. Pittsburgh, PA: Howard L. Rosenthal and Keith T. Poole, Carnegie Mellon University, Graduate School of Industrial Administration [producers], 1991. Ann Arbor, MI: Inter-university Consortium for Political and Social Research [distributor], 2000. http://webapp.icpsr.umich.edu/cocoon/ICPSR-STUDY/09822.xml

See Also

rollcall

Examples

Run this code
h107 <- readKH("ftp://voteview.com/hou107kh.ord",
                desc="107th U.S. House of Representatives")

s107 <- readKH("ftp://voteview.com/sen107kh.ord",
                desc="107th U.S. Senate")

## Jeff Lewis has quasi-real-time roll call data on his site
## in the Poole/Rosenthal format
s109 <- readKH("http://adric.sscnet.ucla.edu/rollcall/static/S109.ord",
               desc="109th U.S. Senate",
               debug=TRUE)

Run the code above in your browser using DataLab