Skip to content
Prev 10529 / 20628 Next

Bug in afex, pbkrtest or lme4 in parametric bootstrapping?

Dear Henrik,
Many thanks for this fast response!
The other error I mentioned apparently was due to me having afex_0.6-77 installed, or loading it after lme4 (I think that masked lme4's refit), with afex_0.5-71 being loaded first it did what you describe.

But when I then try what you suggest
t1 <-
+     mixed(ALATES~ANT_TENDED*MELEZITOSE+NR_START+(1|CLONES)+(1|PLANT)+(1|REPLICATE),
+           type=3, family=poisson,method="LRT",data=data_alates)
I get
Error in mixed(ALATES ~ ANT_TENDED * MELEZITOSE + NR_START + (1 | CLONES) +  : 
  Only methods "KR" or "PB" currently implemented.

Any thoughts?

Cheers,
Tom

-----Original Message-----
From: Henrik Singmann [mailto:henrik.singmann at psychologie.uni-freiburg.de] 
Sent: 21 August 2013 20:19
To: Tom Wenseleers; sorenh at mail.dk; Ben Bolker (bbolker at gmail.com); r-sig-mixed-models at r-project.org
Subject: Re: Bug in afex, pbkrtest or lme4 in parametric bootstrapping?

Hi Tom,

I cannot replicate the exact error message ('unable to find an inherited method for function 'refit' for signature '"glmerMod"') as this is an error message from previous versions of pbkrtest (it still happened with pbkrtest_0.3-5).

However, there seem to be a different issue with the data, when I run I constantly get:
Error: pwrssUpdate did not converge in 30 iterations

(and occasionally a warning: In pwrssUpdate(pp, resp, tolPwrss, GQmat, compDev, fac, verbose) :
Cholmod warning 'not positive definite' at file:../Cholesky/t_cholmod_rowfac.c, line 431)

The error message seems to hint that "the bootstrap samples failed to converge. This is a common situation, as it is just a special case of the general fact that not all glmer models are guaranteed to converge." 
(http://thread.gmane.org/gmane.comp.lang.r.lme4.devel/10440/focus=10441)

That means, you could simply try many times, until you find a solution that converges. For this to work you could try something like:

# calculate the models only and noparametric bootstrap:
t1 <-
mixed(ALATES~ANT_TENDED*MELEZITOSE+NR_START+(1|CLONES)+(1|PLANT)+(1|REPLICATE),
type=3, family=poisson,method="LRT",data=data_alates)

# use PBmodcomp on it's own, until it works:
PBmodcomp(t1[[2]], t1[[3]][[1]], nsim = 10) PBmodcomp(t1[[2]], t1[[3]][[2]], nsim = 10) # and so forth

The order of models in t1 is the same as in the response table (here only using LRTs):
t1
## Effect df.large df.small chisq df p
## 1 (Intercept) 8 7 0.18 1 0.6744
## 2 ANT_TENDED 8 7 2.59 1 0.1074
## 3 MELEZITOSE 8 7 0.78 1 0.3783
## 4 NR_START 8 7 0.89 1 0.3444
## 5 ANT_TENDED:MELEZITOSE 8 7 0.68 1 0.4108

Alternatively, you could wait for S?ren and/or Ben to come up with a solution that tries longer or just live with the likelihood ratio test p-values.

Cheers,
Henrik


Tom Wenseleers schrieb:
--
Dipl. Psych. Henrik Singmann
PhD Student
Albert-Ludwigs-Universit?t Freiburg, Germany http://www.psychologie.uni-freiburg.de/Members/singmann