Skip to content
Prev 10850 / 20628 Next

plot log transformed variable with Effects package

<John.Morrongiello at ...> writes:
(or any transformed) terms.
library(lme4)
library(effects)
data(cake, package="lme4")
fm1 <- lmer(angle ~ recipe * temperature
 + (1|recipe:replicate), 
  cake, REML = FALSE)

plot(Effect(c('recipe','temperature'), fm1))
##but this doesn't (log transformed angle)

fm2 <- lmer(log(angle) ~ recipe * temperature + (1|recipe:replicate), 
 cake, REML = FALSE)

plot(Effect(c('recipe','temperature'), fm2))
This is probably something to take up with the maintainer of
the 'effects' package, who in turn might have to consult the lme4
maintainers.  The proximal problem occurs in 

  plot -> Effect -> Effect.merMod -> Effect.mer -> Effect ->
mer.to.glm

  There is a 'data' object that appears to be coming from the
model.frame() of the original object, but I haven't tracked its
source down yet -- but the problem is that it has log(angle) rather
than angle as a column ...