[R-sig-ME] bug?
Ben Bolker
bolker at zoology.ufl.edu
Wed Aug 20 15:00:07 CEST 2008
Antonio.Gasparrini at lshtm.ac.uk wrote:
> Dear all,
>
> I found a problem with 'lme4'. Basically, once you load the package 'aod' (Analysis of Overdispersed Data), the functions 'lmer' and 'glmer' don't work anymore:
>
> library(lme4)
> (fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
> (gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
> family = binomial, data = cbpp))
> install.packages("aod")
> library(aod)
> (fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy))
> (gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
> family = binomial, data = cbpp))
>
> Taking into account that this package is used to perform similar analyses, this could be a problem.
>
> All the best
>
It looks like you already posted this to r-help and got some answers
(i.e., this is a problem with aod changing the S4 method for "AIC").
For convenience, I sometimes use functions like this
load_lme4 <- function() {
try(detach("package:nlme"),silent=TRUE)
library(lme4)
}
load_nlme <- function() {
try(detach("package:lme4"),silent=TRUE)
library(nlme)
}
to switch back and forth between lme4 and nlme (which also
don't play all that nicely with each other) -- you could do
the same sort of thing if you are going to use lme4 and aod
in the same R session.
Ben Bolker
More information about the R-sig-mixed-models
mailing list