Dear List,

I accidentally came across some strange behavior using the new lme4
package, which was much less of an issue with the old version, now called
lme4.0.

In a model with a 2 x 2 factorial design, the order in which the predictors
are entered into the formula has a substantial impact on the random effects
results, as well as on the total deviance. (The fixed effects estimates are
identical.)

You can duplicate my results as follows:

dat <- read.csv("http://www.danielezrajohnson.com/dej_test.csv")

mm.1 <- lmer(response ~ focus * order + (focus * order | subject), dat)
mm.2 <- lmer(response ~ order * focus + (order * focus | subject), dat)

# package lme4.0_0.999999-3
deviance(mm.1)  # 2158.299
deviance(mm.2)  # 2158.293

# package lme4_1.0-5
deviance(mm.1)  # 2171.469
deviance(mm.2)  # 2160.652

If you inspect the random effect variances and correlation parameters, you
will see that they differ much more between mm.1 and mm.2 when these have
been fit with the lme4_1.0-5 package, although there are still some
non-trivial differences with lme4_0.

Even though the fixed effects estimates themselves are identical when the
order of terms is reversed, the differences in the random effects ensure
that any inference on the fixed effects will be affected.

It is admittedly true that this data diverges in several respects from the
ideal. The values of "response" are not continuous, they are in 0:10, and
their distribution is heavily left-skewed in all cells.

Nevertheless, I can't see that this should set up a situation where the
mere order of terms in the formula has a substantial effect on the fitted
model, let alone why this problem, if we see it as such, should be much
worse with the newer version of the package.

Any advice would be much appreciated.

Thanks,
Daniel

	[[alternative HTML version deleted]]

