Skip to content

lme4 versus nlme

3 messages · Kevin E. Thorpe, Doran, Harold, Simon Blomberg

#
I'm a bit confused.

I have started reading Pinheiro and Bates, which is excellent.  I am
trying to rationalize when one would use lmer() and when one would use
lme() (I know lmer() is not covered in the book).

I have read a number of the treads about why p-values have been taken
out of lmer() stuff.  Naturally, they still exist in nlme.  Presumably,
I should not trust those p-values either.

The problem still remains that I am encountered more and more situations
where it seems I need a mixed model.  The investigator wants to know if
the groups differ.  What is the recommended approach to answering those
kinds of questions?

Thank you,

Kevin
#
Kevin:

lmer is a bit more general, and a heck of a lot faster. The nlme
function is designed for cases where there is a strict nesting structure
to the data. You can code for situations in which there are crossed
random effects, but it is clunky and slooooooow. lmer, on the other
hand, is specifically optimized for fully crossed or partially crossed
data and is very fast. It also works for data that are strictly nested.

There are some vignettes in the lme4 package that you can read to see
examples of how to use the lmer function. There are also some nifty
functions that go along with lmer that do not exists for nlme like
mcmcsamp.

Harold
#
lmer is really good for crossed random effects models. They are easy to
fit and fast, as Harold said. However, lmer still (? Doug?) lacks the
ability to incorporate complex covariance structures for the random
effects and the residuals. I find I need that facility a lot, so I
generally stick with the nlme package. You should only trust the F tests
for the fixed effects for nested, balanced designs. lme is set up to
make nested designs easy to code, and crossed random designs a lot more
difficult to code. So including p-values for the fixed effects in lme
seems reasonable.

HTH,

Simon.
On Thu, 2008-03-13 at 15:02 -0400, Doran, Harold wrote: