Learn R Programming

psychotools (version 0.2-0)

btReg.fit: Bradley-Terry Model Fitting Function

Description

btReg.fit is a basic fitting function for simple Bradley-Terry models.

Usage

btReg.fit(y, weights = NULL, type = c("loglin", "logit"), ref = NULL,
  undecided = NULL, position = NULL, start = NULL, vcov = TRUE, estfun = TRUE,
  ...)

Arguments

y
paircomp object with the response.
weights
an optional vector of weights, interpreted as case weights (integer only).
type
character. Should an auxiliary log-linear Poisson model or logistic binomial be employed for estimation? The latter is only available if not undecided effects are estimated.
ref
character or numeric. Which object parameter should be the reference category, i.e., constrained to zero?
undecided
logical. Should an undecided parameter be estimated?
position
logical. Should a position effect be estimated?
start
numeric. Starting values when calling glm.fit.
vcov
logical. Should the estimated variance-covariance be included in the fitted model object?
estfun
logical. Should the empirical estimating functions (score/gradient contributions be included in the fitted model object?
...
further arguments passed to functions.

Value

  • btReg.fit returns an S3 object of class "btReg", i.e., a list with components as follows.
  • coefficientsestimated parameters on log-scale (without the first parameter which is always constrained to be 0),
  • vcovcovariance matrix of the parameters in the model,
  • logliklog-likelihood of the fitted model,
  • dfnumber of estimated parameters,
  • estfunempirical estimating function (also known as scores or gradient contributions),
  • weightsthe weights used (if any),
  • nnumber of observations (with non-zero weights),
  • typecharacter for model type (see above),
  • refcharacter for reference category (see above),
  • undecidedlogical for estimation of undecided parameter (see above),
  • positionlogical for estimation of position effect (see above),
  • labelscharacter labels of the objects compared.

Details

btReg.fit 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. btReg.fit returns an object of class "btReg" for which several basic methods are available, including print, plot, summary, coef, vcov, logLik, and worth.

See Also

PCModel.fit, RSModel.fit, RaschModel.fit

Examples

Run this code
## data
data("GermanParties2009", package = "psychotools")

## Bradley-Terry model
bt <- btReg.fit(GermanParties2009$preference)
summary(bt)
plot(bt)

Run the code above in your browser using DataLab