[R-sig-ME] Is there a way to deal with errors such as this?

Daniel Lüdecke d@|uedecke @end|ng |rom uke@de
Sun Dec 15 11:20:56 CET 2019


The model seems to fit w/o error when you use "glmmTMB". Unlike glmmADAPTIVE, which uses a more time consuming adaptive Gaussian quadrature rule, glmmTMB might be faster to run the models (even faster than glmer(), probably).

 

library(glmmTMB)

fit <- glmmTMB(

  cbind(Dead, Alive) ~ (0 + Trt) / Dose + (Dose | Rep),

  data = dat,

  family = binomial(link = "probit")

)

 

parameters::model_parameters(fit)

#> Parameter             | Coefficient |   SE |         95% CI |     z |  df |      p

#> ----------------------------------------------------------------------------------

#> Trt16hour10deg        |       -0.74 | 0.33 | [-1.38, -0.10] | -2.26 | 109 | 0.024 

#> Trt16hour20deg        |        0.13 | 0.33 | [-0.52,  0.78] |  0.40 | 109 | 0.691 

#> Trt16hour5deg         |       -0.86 | 0.32 | [-1.48, -0.24] | -2.71 | 109 | 0.007 

#> Trt8hour10deg         |       -0.12 | 0.37 | [-0.84,  0.60] | -0.32 | 109 | 0.749 

#> Trt8hour20deg         |       -0.87 | 0.31 | [-1.49, -0.26] | -2.79 | 109 | 0.005 

#> Trt8hour5deg          |       -0.77 | 0.31 | [-1.38, -0.17] | -2.50 | 109 | 0.012 

#> Trt16hour10deg : Dose |        0.16 | 0.01 | [ 0.14,  0.19] | 13.50 | 109 | < .001

#> Trt16hour20deg : Dose |        0.23 | 0.02 | [ 0.18,  0.28] |  9.35 | 109 | < .001

#> Trt16hour5deg : Dose  |        0.08 | 0.01 | [ 0.07,  0.09] | 13.42 | 109 | < .001

#> Trt8hour10deg : Dose  |        0.08 | 0.01 | [ 0.07,  0.10] | 10.84 | 109 | < .001

#> Trt8hour20deg : Dose  |        0.17 | 0.01 | [ 0.15,  0.19] | 16.59 | 109 | < .001

#> Trt8hour5deg : Dose   |        0.05 | 0.00 | [ 0.04,  0.06] | 14.52 | 109 | < .001

 

Best

Daniel

 

-----Ursprüngliche Nachricht-----
Von: R-sig-mixed-models <r-sig-mixed-models-bounces using r-project.org> Im Auftrag von Rolf Turner
Gesendet: Sonntag, 15. Dezember 2019 02:20
An: r-sig-mixed-models using r-project.org
Betreff: [R-sig-ME] Is there a way to deal with errors such as this?

 

 

By "this" I mean as demonstrated in the following code.  The file 

testData.txt is attached.

 

X <- dget("testData.txt")

library(lme4)

fit <- glmer(cbind(Dead,Alive) ~ (0+Trt)/Dose + (Dose | Rep),

              data=X,family=binomial(link="probit"))

 

The foregoing falls over with the (rather complex) error message:

 

> Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GHrule(0L), compDev = compDev,  : 

>   (maxstephalfit) PIRLS step-halvings failed to reduce deviance in pwrssUpdate

 

I note that mixed_model() from GLMMadaptive seems to be able to deal 

with these data and this model:

 

library(GLMMadaptive)

fit <- mixed_model(fixed=cbind(Dead,Alive) ~ (0+Trt)/Dose,

                    random=~Dose | Rep,

                    data=X,family=binomial(link="probit"))

 

The foregoing runs without complaint.

 

I am applying the glmer() model in the context of doing some fairly 

elaborate simulations (in which "X" gets randomly generated) and the 

error causes the simulations to crash unpleasantly.  So I would *like* a 

magic incantation that I can apply in an automated way to prevent the

error from occurring.

 

I can of course wrap function calls up in try() and if there is an error

generate a new data set and go again.  However I'm a little apprehensive

that this might bias the results of the simulations in some way.

 

I could also switch to using mixed_model(), but would prefer to stick 

with the devil I know (i.e. glmer()) for the sake of consistency with 

other work that I have done.  (And who knows?  Maybe in the course of 

the simulations mixed_model() might fall over too, from time to time.)

 

I'd appreciate any avuncular (or materteral) advice that anyone might be 

inclined to offer.

 

cheers,

 

Rolf

 

-- 

Honorary Research Fellow

Department of Statistics

University of Auckland

Phone: +64-9-373-7599 ext. 88276

--

_____________________________________________________________________

Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg | www.uke.de
Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Marya Verdel
_____________________________________________________________________

SAVE PAPER - THINK BEFORE PRINTING

	[[alternative HTML version deleted]]



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