bt: Bradley-Terry model for contingency table

View source: R/bt.R

btR Documentation

Bradley-Terry model for contingency table

Description

Bradley-Terry model for contingency table

Usage

bt(x)

Arguments

x

the data table.

Details

This function calculates statistics under Bradley-Terry model.

Value

The returned value is a list containing:

  • y A column of 1.

  • count the frequency count/weight.

  • allele the design matrix.

  • bt.glm a glm.fit object.

  • etdt.dat a data table that can be used by ETDT.

Note

Adapted from a SAS macro for data in the example section.

Author(s)

Jing Hua Zhao

References

\insertRef

bradley52gap

\insertRef

sham95gap

\insertRef

copeman95gap

See Also

mtdt

Examples

## Not run: 
x <- matrix(c(0,0, 0, 2, 0,0, 0, 0, 0, 0, 0, 0,
              0,0, 1, 3, 0,0, 0, 2, 3, 0, 0, 0,
              2,3,26,35, 7,0, 2,10,11, 3, 4, 1,
              2,3,22,26, 6,2, 4, 4,10, 2, 2, 0,
              0,1, 7,10, 2,0, 0, 2, 2, 1, 1, 0,
              0,0, 1, 4, 0,1, 0, 1, 0, 0, 0, 0,
              0,2, 5, 4, 1,1, 0, 0, 0, 2, 0, 0,
              0,0, 2, 6, 1,0, 2, 0, 2, 0, 0, 0,
              0,3, 6,19, 6,0, 0, 2, 5, 3, 0, 0,
              0,0, 3, 1, 1,0, 0, 0, 1, 0, 0, 0,
              0,0, 0, 2, 0,0, 0, 0, 0, 0, 0, 0,
              0,0, 1, 0, 0,0, 0, 0, 0, 0, 0, 0),nrow=12)

# Bradley-Terry model, only deviance is available in glm
# (SAS gives score and Wald statistics as well)
bt.ex<-bt(x)
anova(bt.ex$bt.glm)
summary(bt.ex$bt.glm)

## End(Not run)


gap documentation built on Sept. 11, 2024, 5:36 p.m.