7

I estimated a random coefficient hazard model using the glmer command (from the lme4 package) in R. The command looks like the follwing.

(logit.full <-
   glmer(event ~ 
    + V12 * I(V1 - 2)
    + V13
    + V9 * I(V5 - 2)
    + V11
    + V10
    + V2
    + V3
    + V4
    + V6 + V7 + V8
    + (1 + V6 + V7 + V8 | V14),
    family=binomial("logit"), data=dataset, 
    verbose=TRUE, control=list(maxIter=400)))

The model has been working fine for the past three months. Now, after updating the package to 1.0-4, there seems to be a problem with the "control" command and I get the following error message:

Warning in glmer(event ~ a1+a2+a3 :
  Use control=glmerControl(..) instead of passing a list of class “list”
Error in function (optimizer = c("bobyqa", "Nelder_Mead"), restart_edge = FALSE,  : 
  unused argument(s) (maxIter = 400)

Does anyone know how to solve this problem?

user2206985
  • 313
  • 1
  • 3
  • 7
  • Hmmmm. Perhaps you should use `control=glmerControl(..)` instead of passing a list of class "list". – Hong Ooi Sep 25 '13 at 08:55
  • Thanks for the helpful hint. My problem is, that I do not know, how to limit the Iterations with the control=glmerControl(..) command – user2206985 Sep 25 '13 at 09:15

1 Answers1

8

From ?glmerControl:

optCtrl: a ‘list’ of additional arguments to be passed to the nonlinear optimizer (see ‘Nelder_Mead’, ‘bobyqa’). In particular, both ‘Nelder_Mead’ and ‘bobyqa’ use ‘maxfun’ to specify the maximum number of function evaluations they will try before giving up - in contrast to ‘optim’ and ‘optimx’-wrapped optimizers, which use ‘maxit’.

Admittedly this is a small part of a fairly long and complex help page.

so control=glmerControl(optCtrl=list(maxfun=...)) should do it.

I can see this is likely to be a FAQ, so we may add some special code to detect this case (and/or add a more prominent note to the documentation).

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Ok, thank you very much. However, now after using the new uptdate of the package, I get first the warning "warning in rankMatrix(X) : rankMatrix(, method = 'tolNorm2') coerces to dense matrix. Probably should rather use method = 'qrLINPACK' !?" and after calculating the model a error message that the model failed to converge. However, in the previous Version of the package, the model run perfectly. Is there a possibility to get the old Version of the package back? (When I now try to install 0.999999-2.tar.gz, I get the error of non-compatibility with R 2.15-3) – user2206985 Sep 25 '13 at 12:20
  • you should be able to install `lme4.0`, a backward-compatible version of `lme4`. It's on the repository at `http://lme4.r-forge.r-project.org/repos`, but the version there for 2.15 may be a little old. You have a variety of choices but they depend a bit on your OS, whether you have compilation tools installed, etc.. I would also be interested in seeing your data; when you run the model in the old version of `lme4`, do you get large values of the coefficients (|beta|>5) ? – Ben Bolker Sep 25 '13 at 12:53
  • I am using the 64-Bit Version of Windows 7. When I am trying to install lme4 Version 0.99999911-1 I get the error message: "Warning in install.packages : package C/.../lme4_0.99999911-1.zip’ is not available (for R version 2.15.3)". I have got one coefficient larger than 5 (5.16), the rest of the 20 coefficients are below. – user2206985 Sep 25 '13 at 13:20
  • what happens if you download http://lme4.r-forge.r-project.org/repos/bin/windows64/contrib/2.15/lme4_0.99999911-1.zip and try to install it locally? – Ben Bolker Sep 25 '13 at 13:24
  • 1
    is there any chance you can send your data so we can use it to diagnose/fix the problem? – Ben Bolker Sep 25 '13 at 13:25
  • Local installation leads to the same problem and the error message of non-availability for R version 2.15.3 – user2206985 Sep 25 '13 at 13:38
  • Here's the link to the dataset https://dl.dropboxusercontent.com/u/24826628/dataset.csv and the link to the corresponding model: https://dl.dropboxusercontent.com/u/24826628/code.r – user2206985 Sep 25 '13 at 15:17
  • what are the column names in your data set? The first row of the dropbox data set is `id;V1;V2;V3;event;V4;V5;V6;V7;V8;V9;V10;V11;V12;V13;V14`, making it impossible for me to pick out the predictors `a[1-3]`, `obsnum[1-3]`, `country_cluster` – Ben Bolker Sep 25 '13 at 17:10
  • The second link is a link to the corresponding R model. I originally did not display the whole model, but now I have also updated the model there. – user2206985 Sep 26 '13 at 06:26
  • I am still working on this. I ran the model in lme4.0 and there is pretty clear some (near-)complete separation going on (parameters estimates with large absolute value, i.e. in the range of 16 to 18), and lme4.0 reports false convergence, but we will still try to make it work. – Ben Bolker Sep 30 '13 at 14:19