[R-sig-ME] Struggle with glmer().

Anthony R. Ives arives at wisc.edu
Sun Jul 16 14:14:52 CEST 2017


To make sure somebody speaks to you … but probably no big India rubber ball [1].

I tried your code with the "nAGQ=0" option, and it fit quickly. The "non-converged" fit under the default was very similar for the point estimates of the fixed effects. Ben should confirm this, but in my experience the nAGQ=0 option is normally pretty good, and it also handles pathological cases when the random effects estimates explode.

Cheers, Tony

On 7/16/17, 4:57 AM, "R-sig-mixed-models on behalf of Rolf Turner" <r-sig-mixed-models-bounces at r-project.org on behalf of r.turner at auckland.ac.nz> wrote:

    To all and sundry, near and far,
    Ben Bolker in particular :-) .... [1]
    For a considerable time I have been struggling with a problem that would 
    appear to require application of the glmer() function from lme4.  The 
    main thrust of the problem involves estimation of lethal dose levels 
    (e.g. LD99) for a certain pest elimination treatment.  It seems to be 
    impossible to get glmer() to return a fit of the relevant model without 
    producing a number of dire and ominous warnings.
    The principal investigator on the problem has managed to get a 
    linearisation of the model to produce an almost-satisfactory fit, but 
    that's an "almost", but not quite.  I won't go into details about this 
    now, because it's mostly off the point.
    The data involved are confidential, so I can't show you those; instead I 
    have written a function to generate artificial data (which are 
    superficially similar to the real data but are much tidier and without 
    the quirks and peculiarities of the real data). The artificial data are 
    nicely balanced (unlike the real data).
    The simulated data set has 1080 records [2].  I would not have thought 
    this to be an overwhelmingly large data set.
    I have attached the code of my data generating function "artSim()".
    The coefficients of the fixed effects ("beta0" and "beta1") and the
    variance components ("Sigma") are designed to be roughly similar to 
    estimates obtained from the "linearisation" mentioned above.
    Having written "artSim()" I tried:
    X <- artSim()
    fit <- glmer(cbind(Dead,Alive) ~ (Trt + 0)/x + (x | Rep),
    After a fairly lengthy wait, I was not too surprised to get the same 
    ominous warnings that I got with the real data:
    > Warning messages:
    > 1: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    >   unable to evaluate scaled gradient
    > 2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    >   Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
    Could I prevail upon you wise and knowledgeable people to have a look at
    my simulation function and the fitting procedure and let me know if I am 
    doing something silly?
    One last comment --- with the real data, I have tried using estimates 
    obtained from the "linearised" model as starting values for glmer(). 
    This simply made matters worse!  In addition to the foregoing warnings I 
    got a warning about "failure to converge in 10000 evaluations".
    I haven't bothered to try this device with the simulated data ....
    Thanks for any avuncular (or materteral!) advice that anyone can provide.
    Rolf Turner
    Technical Editor ANZJS
    Department of Statistics
    University of Auckland
    Phone: +64-9-373-7599 ext. 88276
    [1] Cf. "King John's Christmas" by A. A. Milne
    [2] The pest elimination treatment under study is *not* 1080!!! The 
    presence of that number is purely coincidental!!! :-)

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