vectorRepresentation          package:pscl          R Documentation

_c_o_n_v_e_r_t _r_o_l_l _c_a_l_l _m_a_t_r_i_x _t_o _s_e_r_i_e_s _o_f _v_e_c_t_o_r_s

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

     Extract the information in a roll call matrix as a series of
     vectors with voting decision, a unique identifier for the
     legislator and a unique identifier for the roll call.

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

     vectorRepresentation(object, dropList = list(codes = c("missing", "notInLegis")))

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

  object: an object of class 'rollcall'

dropList: a 'dropList'; see 'dropRollCall'

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

     It is often the case that roll call matrices are sparse, say, when
     the roll call matrix has an "overlapping generations" structure;
     e.g., consider forming data by pooling across a long temporal
     sequence of legislatures such that relatively few of the
     legislators in the data set actually vote on any given roll call. 
     In such a case, representing the data as a roll call matrix is not
     particularly helpful nor efficient, either for data summaries or
     modeling.

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

     A 'matrix' with 'z' rows, where 'z' is the number of non-missing
     entries in 'object$votes', with 'missingness' defined by the
     'codes' component of the 'dropList'.  The matrix has 3 columns: 

    vote: the voting decision, either a '1' if the corresponding
          element of the roll call matrix 'object$votes' is in the
          'yea' component of 'object$codes', or a '0' if the
          corresponding element of the roll call matrix is in the 'nay'
          component of 'object$codes'.  Non-missing entries of the roll
          call matrix are not stored.

       i: the row of the roll call matrix 'object$votes' that supplied
          the voting decision; i.e., a unique identifier for the
          legislator generating this 'vote'

       j: the column of the roll call matrix 'object$votes' that
          supplied the 'vote'; i.e., a unique identifier for the vote.

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

     Simon Jackman jackman@stanford.edu

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

     'rollcall'

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

     data(s109)
     y <- vectorRepresentation(s109)
     apply(y,2,table,exclude=NULL)

