BradleyTerry2 icon indicating copy to clipboard operation
BradleyTerry2 copied to clipboard

Error in v1.0-8 about the structure of the data for the random factor

Open wcornwell opened this issue 6 years ago • 3 comments

Hello,

I had some code that seemed to be working with v1.0-6, but when I updated to v1.0-8, the model call returns an error.

model1<-BTm(player1=winner,player2=loser,
            formula = ~ prev +   
              (1|ID), id="ID",data=dataset)

which still in v1.0-6 runs (apparently) well, but in v1.0-8 it returns this error

Error in (function (fixed, random = NULL, family = "binomial", data = NULL, : 
`random` should be a matrix object, with 596 rows.

the traceback is pretty cryptic at least to me:

Error in (function (fixed, random = NULL, family = "binomial", data = NULL, : 
`random` should be a matrix object, with 596 rows.
5.
stop("`random` should be a matrix object, with ", nrow(modelData), " rows.")
4.
(function (fixed, random = NULL, family = "binomial", data = NULL, subset = NULL, weights = NULL, offset = NULL, na.action = NULL, start = NULL, etastart = NULL, mustart = NULL, control = glmmPQL.control(...), sigma = 0.1, sigma.fixed = FALSE, model = TRUE, x = FALSE, ...
3.
eval(fit, parent.frame())
2.
eval(fit, parent.frame())
1.
BTm(player1 = winner, player2 = loser, formula = ~prev + (1 | ID), id = "ID", data = dataset)

This is probably my mistake, but I'm having trouble tracking down where it's coming from. Any thoughts?

wcornwell avatar Oct 04 '17 23:10 wcornwell