Learn R Programming

ridittools (version 0.1)

toridit: Compute ridit scores for group

Description

Computes the vector of ridit scores corresponding to a vector of counts or proportions.

Usage

toridit(v)

Arguments

v

vector of counts or proportions

Value

vector of ridit scores

References

Fleiss, J.,L., (1981), Statistical Methods for Rates and Proportions. New York: John Wiley & Sons, p. 152

Examples

Run this code
# NOT RUN {
# PolitiFact ratings for Barack Obama in order of increasing truthfulness (8 Mar 2018)
toridit(c(9, 71, 70, 161, 165, 123)) # counts
toridit(c(.02, .12, .12, .27, .28, .21)) # proportions

## The function is currently defined as
function (v)
{
    (cumsum(v) - 0.5 * v)/sum(v)
  }
# }

Run the code above in your browser using DataLab