Skip to content
Prev 10531 / 20628 Next

Bug in afex, pbkrtest or lme4 in parametric bootstrapping?

This takes care of the proximal problem but I still have a problem
with this example with the latest versions of everything --


data_alates=read.csv("alates_raw_FINAL3.csv", header=TRUE, fill=TRUE)
## devel pbkrtest from:
## http://people.math.aau.dk/~sorenh/software/pbkrtest/devel/
## devel afex from r-forge
## devel lme4 from github
library(afex)
sapply(c("afex","lme4","pbkrtest"),function(x)
paste(packageVersion(x),collapse="."))
##     afex      lme4  pbkrtest
##  "0.6.77"   "1.1.0" "0.3.5.1"

mixed(ALATES~ANT_TENDED*MELEZITOSE+NR_START+
      (1|CLONES)+(1|PLANT)+(1|REPLICATE),type=3,
      family=poisson,method="PB",args.test = list(nsim = 10),
      data=data_alates)

## Fitting 6 lmer() models:
## [......]
## Obtaining 5 p-values:
## [Error in pwrssUpdate(pp, resp, tolPwrss, GQmat, compDev, fac,
verbose) :
##   Downdated VtV is not positive definite
## In addition: Warning message:
## In mixed(ALATES ~ ANT_TENDED * MELEZITOSE + NR_START + (1 | CLONES) +  :
##   Numerical variables NOT centered on 0 (i.e., likely bogus results
if in interactions): NR_START



  It seems to fail on the first submodel, which is the model without an
intercept (a pretty weird model, if you ask me ...)


mm <- model.matrix(mm1)
form <- reformulate(c("-1",

colnames(mm)[-1],"(1|CLONES)","(1|PLANT)","(1|REPLICATE)"),response="ALATES")
newdat <- data.frame(list(model.matrix(mm1)[,-1],
                          getME(mm1,"flist"),
                          model.frame(mm1)["ALATES"]),check.names=FALSE)
mm2 <- update(mm1,formula=form,data=newdat)
confint(mm2,method="boot",nsim=20)
## 14/20 bootstrap runs failed

  I don't know whether it is better to devote effort to fixing this on
the lme4 level (i.e. making the optimization more robust), or the
PBmodcomp level (i.e. making it handle fit failures better)
On 13-08-21 02:34 PM, S?ren H?jsgaard wrote: