linear2btl: Linear Coefficients to Bradley-Terry-Luce (BTL) Estimates In eba: Elimination-by-Aspects Models

Description

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

Usage

 `1` ```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

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.

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`

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. doi: 10.2307/2285591

`eba`, `eba.order`, `glm`, `pcX`.
 ``` 1 2 3 4 5 6 7 8 9 10 11``` ```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) ```