randompairs {EloChoice}R Documentation

generate random data of pairwise preference ratings

Description

generate random data of pairwise preference ratings

Usage

randompairs(nstim = 10, nint = 100, reverse = 0.1, skew = FALSE)

Arguments

nstim

numeric, number of stimuli, must be less than 2,602

nint

numeric, number of paired ratings to be created

reverse

numeric, proportion of ratings that go against the default preference, see below for details

skew

logical, by default FALSE, see below for details

Details

The default preference for a given pair is given by their alphanumerical order. E.g. A is preferred over M, and kf over kz. The reverse= argument specifies the proportion of ratings that go against this default order.

The number of appearances of a given stimulus in the data set is by default determined by uniform sampling of individual stimuli, i.e. all stimuli will roughly appear equally often in a data set. If a somewhat more realistic (i.e. unbalanced) distribution is desired, the argument skew=TRUE will achieve sampling based on a negative binomial distribution.

Value

data.frame with winner and loser column. An additional column (index) serves as an index for the sequence in which the trials occurred.

Author(s)

Christof Neumann

Examples

# a relatively balanced data set
xdata <- randompairs(20, 500, skew=FALSE)
table(c(as.character(xdata$winner), as.character(xdata$loser)))
range(table(c(as.character(xdata$winner), as.character(xdata$loser))))

# and a less balanced data set
xdata <- randompairs(20, 500, skew=TRUE)
table(c(as.character(xdata$winner), as.character(xdata$loser)))
range(table(c(as.character(xdata$winner), as.character(xdata$loser))))

[Package EloChoice version 0.29.4 Index]