
Calculate Roll Call Errors and Proportional Reduction in Error (PRE)
Source:R/rc.errors.R
rc.errors.Rd
This function calculates the roll call errors and the Proportional Reduction in Error (PRE) statistic for a given roll call vote. The function can handle both "nomObject" and "OCobject" classes, typically representing NOMINATE or Optimal Classification results.
Usage
rc.errors(obj, data, rcnum, rotMat = diag(2))
Arguments
- obj
An object of class
nomObject
orOCobject
containing the results of a NOMINATE or Optimal Classification analysis.- data
A data frame containing the roll call data, including vote outcomes and codes for "yea" and "nay" votes.
- rcnum
An integer specifying the roll call number for which errors and PRE should be calculated.
- rotMat
A 2x2 rotation matrix used to rotate the coordinates in the case of an
OCobject
. The default is the identity matrix.
Value
A list with the following components:
tot.errors
: A named vector with the total number of "yea" and "nay" errors.PRE
: The Proportional Reduction in Error statistic, calculated as the proportion of errors reduced relative to the worst-case scenario.errors
: A matrix indicating which legislators made errors in their votes, with columns for "yea" and "nay" errors.