pcX: Paired-Comparison Design Matrix

Description Usage Arguments Details Value References See Also Examples

View source: R/EBA_fast.R

Description

Computes a paired-comparison design matrix.

Usage

1
pcX(nstimuli, omitRef = TRUE)

Arguments

nstimuli

number of stimuli in the paired-comparison design

omitRef

logical, if TRUE (default), the first column corresponding to the reference category is omitted

Details

The design matrix can be used when fitting a Bradley-Terry-Luce (BTL) model or a Thurstone-Mosteller (TM) model by means of glm or lm. See Critchlow and Fligner (1991) for more details.

Value

A matrix having (nstimuli - 1)*nstimuli/2 rows and nstimuli - 1 columns (if the reference category is omitted).

References

Critchlow, D.E., & Fligner, M.A. (1991). Paired comparison, triple comparison, and ranking experiments as generalized linear models, and their implementation in GLIM. Psychometrika, 56, 517–533. doi: 10.1007/bf02294488

See Also

eba, thurstone, glm, balanced.pcdesign, linear2btl.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(drugrisk)               # absolute choice frequencies
btl <- eba(drugrisk[, , 1])  # fit Bradley-Terry-Luce model using eba
summary(btl)

y1 <- t(drugrisk[, , 1])[lower.tri(drugrisk[, , 1])]
y0 <-   drugrisk[, , 1][ lower.tri(drugrisk[, , 1])]

## Fit Bradley-Terry-Luce model using glm
btl.glm <- glm(cbind(y1, y0) ~ 0 + pcX(6), binomial)
summary(btl.glm)

## Fit Thurstone Case V model using glm
tm.glm <- glm(cbind(y1, y0) ~ 0 + pcX(6), binomial(probit))
summary(tm.glm)

eba documentation built on Jan. 13, 2021, 10:12 a.m.

Related to pcX in eba...