| linear2btl | R Documentation |
Transforms linear model coefficients to Bradley-Terry-Luce (BTL) model parameter estimates.
linear2btl(object, order = FALSE)
object |
an object of class |
order |
logical, does the model include an order effect? Defaults to FALSE |
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.
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 |
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/2285591")}
eba, eba.order, glm,
pcX.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.