pcFactorStan (version 1.5.4)

generateItem: Generate paired comparison data for one or more items given absolute latent scores

Description

To add a single item, theta should be a vector of latent scores. To add multiple items at a time, theta should be a matrix with one item in each column. Item names can be given as the colnames of theta.

The interpretation of theta depends on the context where the data were generated. For example, in chess, theta represents unobserved chess skill that is partially revealed by match outcomes.

The graph can be regarded as undirected, but data are generated relative to the order of vertices within each row. Vertices do not commute. For example, a -1 for vertices ‘a’ and ‘b’ is the same as 1 for vertices ‘b’ and ‘a’.

Usage

generateItem(df, theta, th = 0.5, name, ..., scale = 1, alpha = 1)

Value

The given data.frame df with additional columns for each item.

Arguments

df

a data frame with pairs of vertices given in columns pa1 and pa2, and item response data in other columns

theta

a vector or matrix of absolute latent scores. See details below.

th

a vector of thresholds

name

a vector of item names

...

Not used. Forces remaining arguments to be specified by name.

scale

a vector of scaling constants

alpha

a vector of item discriminations

Response model

See cmp_probs for details.

See Also

Other item generators: generateCovItems(), generateFactorItems(), generateSingleFactorItems()

Examples

Run this code
df <- roundRobinGraph(letters[1:5], 40)
df <- generateItem(df)

Run the code above in your browser using DataLab