[R-sig-ME] Is there a way to deal with errors such as this?
r@turner @end|ng |rom @uck|@nd@@c@nz
Sun Dec 15 02:20:25 CET 2019
By "this" I mean as demonstrated in the following code. The file
testData.txt is attached.
X <- dget("testData.txt")
fit <- glmer(cbind(Dead,Alive) ~ (0+Trt)/Dose + (Dose | Rep),
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:
fit <- mixed_model(fixed=cbind(Dead,Alive) ~ (0+Trt)/Dose,
random=~Dose | Rep,
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.
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the R-sig-mixed-models