addbounds function

Augment with Boundaries Between Rating Scale Categories and Rank

Augment with Boundaries Between Rating Scale Categories and Rank

Adds q - 1 boundaries between the q ratings to the columns of matrix x, and convert the rows to rankings, starting with 0 for the lowest ranking. Ties are handled by averaging the total rank for all tied observations.

addbounds(x, q = max(x), ties = "average")

Arguments

  • x: matrix (or data frame) of n rows and m columns, or an object that can be coerced to a matrix via as.matrix.
  • q: scalar; the number of rating scale categories. Defaults to the maximum entry in x.
  • ties: character; handling of ties in rank

Returns

A matrix of size n by m + q - 1

Details

Any x which is not a matrix or data frame will cause an error.

Examples

set.seed(1234) mat <- matrix(sample(1:9, 12, replace = TRUE), nrow = 4, ncol = 3) addbounds(mat, q = 9)

Author(s)

Pieter C. Schoonees

  • Maintainer: Pieter Schoonees
  • License: GPL (>= 2)
  • Last published: 2016-01-05

Useful links