readKH                 package:pscl                 R Documentation

_r_e_a_d _r_o_l_l _c_a_l_l _d_a_t_a _i_n _P_o_o_l_e-_R_o_s_e_n_t_h_a_l _K_H _f_o_r_m_a_t

_D_e_s_c_r_i_p_t_i_o_n:

     Creates a 'rollcall' object from the flat file format for roll
     call data used by Keith Poole and Howard Rosenthal.

_U_s_a_g_e:

     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)

_A_r_g_u_m_e_n_t_s:

    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 data
          files.

     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/Rosenthal data
          files.

 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 files.

    desc: string, describing the data, e.g., '82nd U.S. House of
          Representatives'; default is 'NULL'

   debug: logical, print debugging information for net connection

_D_e_t_a_i_l_s:

     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):

     _I_C_P_S_R _l_e_g_i_s_l_a_t_o_r _u_n_i_q_u_e _I_D 4-8

     _I_C_P_S_R _s_t_a_t_e _I_D 9-10

     _C_o_n_g_r_e_s_s_i_o_n_a_l _D_i_s_t_r_i_c_t 11-12

     _s_t_a_t_e _n_a_m_e 13-20

     _p_a_r_t_y _c_o_d_e 21-23

     _l_e_g_i_s_l_a_t_o_r _n_a_m_e 26-36

     _r_o_l_l-_c_a_l_l _v_o_t_i_n_g _r_e_c_o_r_d 37 to end-of-record

     This function reads data files in that format, and creates a
     'rollcall', for which there are useful methods such as
     'summary.rollcall'.  The 'legis.data' component of the 'rollcall'
     object is a 'data.frame' which contains:

     '_s_t_a_t_e' a 2-character string abbreviation of each legislator'
          state

     '_i_c_p_s_r_S_t_a_t_e' a 2-digit numeric code for each legislator's state,
          as used by the Inter-university Consortium for Political and
          Social Research (ICPSR)

     '_c_d' numeric, the number of each legislator's congressional
          district within each state; this is always 0 for members of
          the Senate    

     '_i_c_p_s_r_L_e_g_i_s' a unique numeric identifer for each legislator
          assigned by the ICPSR, as corrected by Poole and Rosenthal,
          see <URL: http://voteview.com/icpsr.htm>

     '_p_a_r_t_y_N_a_m_e' character string, the name of each legislator's
          political party

     '_p_a_r_t_y' numeric, code for each legislator's political party; see
          <URL: http://voteview.com/PARTY3.HTM>

     The 'rownames' attribute of this data frame is a concatenation of
     the legislators' names, party abbreviations (for Democrats and
     Republicans) and state, and (where appropriate), a district
     number; e.g., 'Bonner (R AL-1)'.  This tag is also provided in the
     'legis.name' component of the returned rollcall object.

     Poole and Rosenthal also make 'dtl' files available for Congresses
     1 through 106. These files contain information about the votes
     themselves, in a multiple-line per vote 'ascii' format, and reside
     in the 'dtl' director of Poole's web site, e.g., <URL:
     ftp://pooleandrosenthal.com/dtl/102s.dtl> is the 'dtl' file for
     the 102nd Senate.  The default is to presume that no such file
     exists. When a 'dtl' file is available, and is read, the
     'votes.data' attribute of the resulting 'rollcall' object is a
     'data.frame' with one record per vote, with the following
     variables:

     '_d_a_t_e' vector of class 'Date', date of the rollcall, if available;
          otherwise 'NULL'

     '_d_e_s_c_r_i_p_t_i_o_n' vector of mode 'character', descriptive text

     The 'dtl' files are presumed to have the date of the rollcall in
     the first line of text for each roll call, and lines 3 onwards
     contain descriptive text.

     Finally, note also that the Poole/Rosenthal data sets often
     include the U.S. President as a pseudo-legislator, adding the
     announced positions of a president or the administration to the
     roll call matrix. This adds an extra "legislator" to the data set
     and can sometimes produce suprising results (e.g., a U.S. Senate
     of 101 senators), and a "legislator" with a surprisingly low party
     loyalty score (since the President/administration only announces
     positions on a relatively small fraction of all Congressional roll
     calls).

_V_a_l_u_e:

     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).

_A_u_t_h_o_r(_s):

     Simon Jackman jackman@stanford.edu

_R_e_f_e_r_e_n_c_e_s:

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

     Poole, Keith.  <URL: 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.  <URL:
     http://webapp.icpsr.umich.edu/cocoon/ICPSR-STUDY/09822.xml>

_S_e_e _A_l_s_o:

     'rollcall'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     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
     s110 <- readKH("http://adric.sscnet.ucla.edu/rollcall/static/S110.ord",
                    desc="110th U.S. Senate (2007-08)",
                    debug=TRUE)
     ## End(Not run)

