[R-sig-ME] Speed estimation for lmer?

Douglas Bates bates at stat.wisc.edu
Fri Sep 12 00:06:32 CEST 2008

On Thu, Sep 11, 2008 at 4:56 PM, Daniel Ezra Johnson
<danielezrajohnson at gmail.com> wrote:
>>> so if my response is on a continuous scale, is there any difference between
>>> lmer(y~fixed+(1|random)) and
>>> glmer(y~fixed+(1|random),family="gaussian") ?
>>> the output is the same but since reading the above i'm wondering if
>>> 'plain' lmer is written to run faster?
>> Those calls will be equivalent but if you look closely at the object
>> produced by the glmer call you will find that it has been quietly
>> replaced by a call to lmer.  There is a section in glmer that reads
>>    if(family$family == "gaussian" && family$link == "identity") {
>>        mc[[1]] <- as.name("lmer")      # use lmer not glmer
>>        mc$family <- NULL
>>        return(eval.parent(mc))
>>    }
> This must be a close cousin of the code that turns e.g.
> d <- lmer(y~fixed(1|random),twelve,family="binomial")
> into a call to glmer!

Yes.  At times I have thought that having a separate glmer function
made sense and at other times I have thought that having lmer handle
linear or generalized linear or nonlinear or generalized nonlinear
mixed models would be the best way to go.  I still don't know and
would prefer not to antagonize all those people who have written
papers and even books mentioning glmer and lmer by removing the glmer
function.  In time it is possible that glmer will become a stub, just
as lmer2 is now.

More information about the R-sig-mixed-models mailing list