[R] bug in either glmmPQL or lme/lmer

Jack Tanner ihok at hotmail.com
Tue Jan 10 02:27:57 CET 2006

I know it's conventional to report bugs to the maintainer, but I'm not sure 
which package actually contains this bug(s), so I apologize for sending this 
to the list at large. I see the bug under both R 2.1.1, and R 2.2.1. (I sent 
a related message a while ago, but this one has more detail.)


fit.model <- function(il, model.family) {
  cs <- Initialize(corSymm(form=~1|id), data=il)
  glmmPQL(score~test+coder, random=~1|id, family=model.family, data=il, 

score <- 
id <- rep(1:13, rep(4, 13))
test <- gl(2, 1, length(score), labels=c("pre", "post"))
coder <- gl(2, 2, length(score), labels=c("two", "three"))

original <- data.frame(id, score, test, coder)

sorted.ok <- original[order(original$id, original$score, original$test, 
sorted2.ok <- original[order(original$id, original$test, original$score, 
sorted3.not.ok <- original[order(original$score, original$id, original$test, 

print(summary(fit.model(original, poisson)))
print(summary(fit.model(sorted.ok, poisson)))
print(summary(fit.model(sorted2.ok, poisson)))
print(summary(fit.model(sorted3.not.ok, poisson)))

That last line produces, under R version 2.1.1, 2005-06-20, i386-pc-mingw32

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets"
[7] "base"

other attached packages:
    MASS     nlme
"7.2-20" "3.1-65"

iteration 1
Error in logLik.reStruct(object, conLin) :
	NA/NaN/Inf in foreign function call (arg 3)

That same last line produces, under R version 2.2.1, 2005-12-20, 

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"     "datasets"
[7] "base"

other attached packages:
      MASS       nlme
  "7.2-24" "3.1-68.1"

iteration 1
Error in lme.formula(fixed = zz ~ test + coder, random = ~1 | id, data = 
list( :
	false convergence (8)

Moreover, summary(fit.model(original, poisson)) produces a different output 
than either
summary(fit.model(sorted.ok, poisson)) or summary(fit.model(sorted2.ok, 
poisson)), but the latter two do equal each other.

More information about the R-help mailing list