Learn R Programming

eba (version 1.10-0)

linear2btl: Linear Coefficients to Bradley-Terry-Luce (BTL) Estimates

Description

Transforms linear model coefficients to Bradley-Terry-Luce (BTL) model parameter estimates.

Usage

linear2btl(object, order = FALSE)

Arguments

object

an object of class glm or lm specifying a BTL model

order

logical, does the model include an order effect? Defaults to FALSE

Value

btl.parameters

a matrix; the first column holds the BTL parameter estimates, the second column the approximate standard errors

cova

the approximate covariance matrix of the BTL parameter estimates

linear.coefs

a vector of the original linear coefficients as returned by glm or lm

Details

The design matrix used by glm or lm usually results from a call to pcX. It is assumed that the reference category is the first level. The covariance matrix is estimated by employing the delta method. See Imrey, Johnson, and Koch (1976) for more details.

References

Imrey, P.B., Johnson, W.D., & Koch, G.G. (1976). An incomplete contingency table approach to paired-comparison experiments. Journal of the American Statistical Association, 71, 614--623. 10.2307/2285591

See Also

eba, eba.order, glm, pcX.

Examples

Run this code
# NOT RUN {
data(drugrisk)
y1 <- t(drugrisk[, , 1])[lower.tri(drugrisk[, , 1])]
y0 <-   drugrisk[, , 1][ lower.tri(drugrisk[, , 1])]

## Fit BTL model using glm (maximum likelihood)
btl.glm <- glm(cbind(y1, y0) ~ 0 + pcX(6), binomial)
linear2btl(btl.glm)

## Fit BTL model using lm (weighted least squares)
btl.lm <- lm(log(y1/y0) ~ 0 + pcX(6), weights=y1*y0/(y1 + y0))
linear2btl(btl.lm)
# }

Run the code above in your browser using DataLab