Calculate Scott's (1955) pi
spi.Rd
spi()
takes two vectors and returns Scott's (1955) pi coefficient,
communicating extent of inter-observer reliability.
Value
spi()
takes two vectors and returns Scott's (1955) pi coefficient,
communicating extent of inter-observer reliability.
Details
The function subsets to complete cases of the two vectors for which you want Scott's pi.
The function implicitly assumes that x1
and x2
are columns in a data
frame. One indirect check for this looks at whether x1
and x2
are the
same length. The function will stop if they're not.
There will sometimes be instances, assuredly with alliances, where not all
categories are observed. For example, the toy example I provide of Germany
and Russia in 1914 includes no 2s. In the language of "ratings", the "rating"
of 2 was available for Germany and Russia in 1914 but neither side used it.
The levels
argument allows you to specify the full sequence of values that
could be observed, even if none were. It probably makes the most sense to
always use this argument, even if the default behavior operates as if you
won't.