dropRollCall              package:pscl              R Documentation

_d_r_o_p _u_s_e_r-_s_p_e_c_i_f_i_e_d _e_l_e_m_e_n_t_s _f_r_o_m _a _r_o_l_l_c_a_l_l _o_b_j_e_c_t

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

     Drop user-specified elements of rollcall object, returning a roll
     call object.

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

     dropRollCall(object, dropList)

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

  object: an object of class 'rollcall'

dropList: a 'list' (or 'alist') with some (or all) of the following
          components:

     '_c_o_d_e_s' character or numeric, possibly a vector.  If character, it
          should match the names of 'object$codes', indicating the set
          of entries in 'object$votes' to be set to 'NA'.  If numeric,
          then 'codes' indicates the entries in 'object$votes' that
          will be set to 'NA'.

     '_l_o_p' numeric, non-negative integer, less than number of
          legislators represented in 'object'.  Roll calls with 'lop'
          or fewer legislators voting in the minority are dropped.

     '_l_e_g_i_s_M_i_n' numeric, non-negative integer, less than number of roll
          calls represented in 'object'.  Legislators with 'legisMin'
          or fewer votes are dropped.

     '_d_r_o_p_L_e_g_i_s' an 'expression' that evaluates to mode 'logical',
          vector of length equal to the number of legislators
          represented in 'object'.  The expression is evaluated in the
          'legis.data' component of the rollcall 'object'. Legislators
          for whom the expression evaluates to 'TRUE' are dropped.

     '_d_r_o_p_V_o_t_e_s' an 'expression' that evaluates to mode 'logical',
          vector of length equal to the number of rollcalls represented
          in 'object'.  The expression is evaluated in the 'votes.data'
          component of the rollcall 'object'. Rollcalls for which the
          expression evaluates to 'TRUE' are dropped. 

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

     It is often desirable to restrict the analysis of roll call data
     in various ways.  For one thing, unanimous votes provide no
     information discriminating among legislators: hence, a useful
     default for summary and analysis is 'dropList=list(lop=0)'. See
     the examples for other possibilities, limited only by the
     information supplied in 'legis.data' and 'votes.data'.

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

     An object of class 'rollcall' with components modified by the
     subsetting indicated in the 'dropList'.

_N_o_t_e:

     With the exception of 'codes', each component of 'dropList'
     generates a vector of mode 'logical', either with respect to
     legislators or votes.  These logical vectors are then combined
     element-wise, such that if any one of the subseting restrictions
     is 'TRUE' for a particular legislator or vote, then that
     legislator or vote is dropped.  Some summaries are reported to the
     console along the way.

     When 'dropList' uses the 'dropLegis' or 'dropVotes' components
     then 'dropList' should be constructed as an 'alist' command; this
     ensures that the 'dropLegis' and 'dropVotes' components of
     'dropList' are objects of mode 'expression', and 'eval'uated to
     mode 'logical' in the 'legis.data' and 'vote.data' 'environment's
     by the function, if possible (rather than being evaluated
     immediately in the environment calling 'dropRollCall' or
     constructing 'dropList').  See the examples.  This is not entirely
     satisfactory, and behavior more like the 'subset' argument in
     function 'lm' would be preferable.

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

     Simon Jackman jackman@stanford.edu

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

     'dropUnanimous', 'summary.rollcall', 'ideal', 'alist'.

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

     data(s109)
     s109.working <- dropRollCall(s109,
                                  dropList=list(lop=0))
     s109.working <- dropRollCall(s109,
                                  dropList=list(lop=0,
                                    code="notInLegis"))
     s109.working <- dropRollCall(s109,
                                  dropList=list(lop=3,
                                    code="notInLegis"))

     ## note use of alist, since dropLegis is an expression
     dropList <- alist(lop=3,
                      dropLegis=party!="D",
                      code="notInLegis")
     s109.working <- dropRollCall(s109,dropList=dropList)

     ## Not run: 
     ## read 102nd House from Poole web site
     h102 <- readKH("ftp://voteview.ucsd.edu/dtaord/hou102kh.ord")

     ## drop President from roll call matrix
     h102 <- dropRollCall(h102,
                          dropList=alist(dropLegis=state=="USA"))
     ## End(Not run)

