Running ‘BTabilities.R’ [2s/2s]
Running the tests in ‘tests/BTabilities.R’ failed.
Complete output:
  > library(BradleyTerry2)
  > 
  > ## refcat is not the first level
  > 
  > ##  Convert frequencies to success/failure data
  > citations.sf <- countsToBinomial(citations)
  > names(citations.sf)[1:2] <- c("journal1", "journal2")
  > 
  > ##  First fit the "standard" Bradley-Terry model
  > citeModel <- BTm(cbind(win1, win2), journal1, journal2, data = citations.sf)
  > BTabilities(citeModel)
                  ability       s.e.
  Biometrika    0.0000000 0.00000000
  Comm Statist -2.9490725 0.10254534
  JASA         -0.4795698 0.06058873
  JRSS-B        0.2689541 0.07082997
  > 
  > ##  Now the same thing with a different "reference" journal
  > citeModel2 <- update(citeModel, refcat = "JASA")
  > BTabilities(citeModel2)
                  ability       s.e.
  Biometrika    0.4795698 0.06058873
  Comm Statist -2.4695027 0.09817049
  JASA          0.0000000 0.00000000
  JRSS-B        0.7485238 0.07294356
  > 
  > ## modelled by covariates where some parameters inestimable
  > 
  > summary(chameleon.model <- BTm(player1 = winner, player2 = loser,
  +    formula = ~ prev.wins.2 + ch.res[ID] + prop.main[ID] + (1|ID), id = "ID",
  +    data = chameleons))
  PQL algorithm converged to fixed effects model
  
  Call:
  BTm(player1 = winner, player2 = loser, formula = ~prev.wins.2 + 
      ch.res[ID] + prop.main[ID] + (1 | ID), id = "ID", data = chameleons)
  
  Deviance Residuals: 
      Min       1Q   Median       3Q      Max  
  0.06415  0.34234  0.58244  1.07561  2.80562  
  
  Coefficients:
                Estimate Std. Error z value Pr(>|z|)    
  prev.wins.2    2.38130    0.48495   4.910 9.09e-07 ***
  ch.res[ID]     0.60931    0.27773   2.194   0.0282 *  
  prop.main[ID]  0.08928    0.04382   2.037   0.0416 *  
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 146.947  on 106  degrees of freedom
  Residual deviance:  85.396  on 103  degrees of freedom
  AIC: 91.396
  
  Number of Fisher Scoring iterations: NA
  
  > head(BTabilities(chameleon.model))
  Error in model.matrix.default(predvars, mf) : 
    model frame and formula mismatch in model.matrix()
  Calls: head ... BTabilities -> model.matrix -> model.matrix.default
  Execution halted