simPC {prefmod}R Documentation

Utility function to simulate paired comparison or rankings data

Description

The function generates a random paired comparison data matrix (two response categories, no undecided) or a rankings data matrix optionally based on user specified worth parameters.

Usage

simPC(nobj, nobs, worth = NULL, seed = NULL, pr = FALSE)
simR(nobj, nobs, worth = NULL, seed = NULL, pr = FALSE)

Arguments

nobj

Number of objects.

nobs

Number of cases.

worth

If NULL, values are drawn from uniform distribution (interval from 0 to 1), otherwise the user may specify arbitrary values. In both cases, the values are transformed into [0,1] and scaled to sum up to 1.

seed

Starting value for the random number generator.

pr

If TRUE, the used worth parameters are printed.

Value

The random data matrix as a data frame

Author(s)

Reinhold Hatzinger

Examples

data<-simPC(4,10,worth=1:4,seed=123456)
data

[Package prefmod version 0.8-32 Index]