btmodel
is a basic fitting function for simple Bradley-Terry models.
btmodel(y, weights = NULL, type = c("loglin", "logit"), ref = NULL,
undecided = NULL, position = NULL, start = NULL, vcov = TRUE, estfun =
FALSE, ...)
btmodel
returns an S3 object of class "btmodel"
,
i.e., a list with components as follows.
paircomp object with the response
estimated parameters on log-scale (without the first parameter which is always constrained to be 0),
covariance matrix of the parameters in the model,
log-likelihood of the fitted model,
number of estimated parameters,
the weights used (if any),
number of observations (with non-zero weights),
character for model type (see above),
character for reference category (see above),
logical for estimation of undecided parameter (see above),
logical for estimation of position effect (see above),
character labels of the objects compared,
empirical estimating function (also known as scores or gradient contributions).
paircomp object with the response.
an optional vector of weights (interpreted as case weights).
character. Should an auxiliary log-linear Poisson model or logistic binomial be employed for estimation? The latter is not available if undecided effects are estimated.
character or numeric. Which object parameter should be the reference category, i.e., constrained to zero?
logical. Should an undecided parameter be estimated?
logical. Should a position effect be estimated?
numeric. Starting values when calling glm.fit
.
logical. Should the estimated variance-covariance be included in the fitted model object?
logical. Should the empirical estimating functions (score/gradient contributions) be included in the fitted model object?
further arguments passed to functions.
btmodel
provides a basic fitting function for Bradley-Terry models,
intended as a building block for fitting Bradley-Terry trees and
Bradley-Terry mixtures in the psychotree package, respectively. While
btmodel
is intended for individual paired-comparison data, the
eba package provides functions for aggregate data.
btmodel
returns an object of class "btmodel"
for which
several basic methods are available, including print
, plot
,
summary
, coef
, vcov
, logLik
, estfun
and worth
.
pcmodel
, gpcmodel
, rsmodel
,
raschmodel
, nplmodel
, the eba package
o <- options(digits = 4)
## data
data("GermanParties2009", package = "psychotools")
## Bradley-Terry model
bt <- btmodel(GermanParties2009$preference)
summary(bt)
plot(bt)
options(digits = o$digits)
Run the code above in your browser using DataLab