bt.test: Systemic test for the assumptions of the Bradley-Terry model

Description Usage Arguments Details Value References Examples

View source: R/bt.test.R

Description

bt.test Systemic test for the assumptions of the Bradley-Terry model, transitivity and monotonic win-loss relationship. That is, if A > B and B > C then A > C and Pr(A beats C) > Pr(B beats C).

Usage

1
bt.test(conf.mat, baseline = 1, maxLength = 2, reps = 1000)

Arguments

conf.mat

an N-by-N matrix. The matrix should be a conflict matrix with element i,j representing the number of times i has beaten j.

baseline

an integer between 1 and N inclusive identifying the agent with dominance index equal to zero.

maxLength

an integer indicating maximum path length used in conductance

reps

an integer indicating number of conflict matrices simulated to estimate the sampling distribution under the BT model.

Details

The value of the test statistic should be within the estimated sampling distribution of the test statistics under the BT model. The p-value of the test indicates the probability of statistics in the estimated sampling distribution is larger than the test statistic. It is not appropriate to use Bradley-Terry model if value of the test statistic is higher than the estimated sampling distribution of the test statistics.

Value

A list of 3 elements.

stat

value of the test statistic

dist

estimated sampling distribution of the test statistics under the BT model.

p.val

p-value of the test

References

Shev, A., Fujii, K., Hsieh, F., & McCowan, B. (2014). Systemic Testing on Bradley-Terry Model against Nonlinear Ranking Hierarchy. PloS one, 9(12), e115367.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# create an edgelist
edgelist1 <- data.frame(col1 = sample(letters[1:15], 200, replace = TRUE),
                        col2 = sample(letters[1:15], 200, replace = TRUE),
                       stringsAsFactors = FALSE)
edgelist1 <- edgelist1[-which(edgelist1$col1 == edgelist1$col2), ]
# convert an edgelist to conflict matrix
confmatrix_bt <- as.conflictmat(edgelist1)
# test the assumptions of the Bradley-Terry model
# not run:
# condTestoutput <- bt.test(confmatrix_bt)

Example output



Perc documentation built on May 12, 2021, 1:08 a.m.