Skip to content
Prev 12834 / 20628 Next

[lme4 package] Does the order of rows(trials) in a data frame (long format) affect the results of the lmer model (maybe somehow)?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 15-01-07 07:13 PM, Zhaohong wrote:
We have seen one case where the order does change the results slightly
(https://github.com/lme4/lme4/issues/262) , and have a
not-yet-reproducible report (see prev link) of a case where the order
changes the standard error estimates considerably more.  That the
order affects the results is surprising, but believable; I/we haven't
had a chance yet to dig through and figure out how the ordering could
change the linear algebra, but clearly it does.

   A couple of comments:

* the factor names are different in your two examples (A/B/C vs
RanOrCt/Direction/Running etc.) -- that makes me mildly suspicious that
there might be some other difference in the input data, but maybe you
just forgot to rewrite something.

   Probably the simplest way to double check these results is to do an
experiment where you input the results from each case as starting values
(e.g. update(model1,start=getME(model2,"theta"))) and see what happens.
Hopefully starting from each of those (very similar) starting points will
get you to the same starting point.

  It would also be worth trying a different optimizer (see
https://rpubs.com/bbolker/lme4trouble1 for examples).

  Having a random effect with only 6 levels (Category) is pushing the
envelope a bit, especially as you're trying to fit an 8x8
variance-covariance
matrix ((A*B*C|Category)); you might try recasting that as a fixed effect.
From comparing with the results below, it looks like the first report
(at step "0.020: 86") is identical between versions, but that the two
versions have diverged slightly by the second report ("0.0020: 1139" in
one case, "0.0020: 1266" in the other)
-0.04  0.57  0.25
- -0.11  0.64
0.61 -0.44 -0.39  0.93
- -0.66
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJUrgPHAAoJEOCV5YRblxUH6qIIAJYKp9Djg4a8mf22WqIJ7tE6
/GzQTfdknwQgXwvMHbUP47YEE/mU0ms92zWwj6gvwKG+NsHmGmOrn+qGgqCS9LzC
fI1ou5nYLrcSb2If+aXPWkQ2VYKbxyCh+ycuwbTqV5tz2LAEujbZYCKck+ZSXXFS
UbazesAW618+A7VRIUWIuUtDSBA6qSchXjSZTsrosmCCS8JVtI5N2eOR/uCP3atn
SPOPSPUy33hZaMLzZHpzSM6EV/nC9CAJGTaBtiSCiWbJbMeQiHiHJ9Nyk65sPoSS
XOFfAl5FffLao6QWOWMRkD1q8eF8Y8hdagpniClxEvDc793zewzWALpBtXAgI0A=
=VEtd
-----END PGP SIGNATURE-----