error with parametric bootstrap for negative binomial model, lme4, pbkrtest
That looks perfect. Someone will definitely respond! On Thu, May 21, 2015 at 10:07 AM, Lauren Catherine Ponisio <
lponisio at gmail.com> wrote:
Hello list members, I was hoping to use the a parametric bootstrap using the pbktest package, PBmodcomp() function. With a negative binomial mixed model I get the following error: Error in lme4::.simulateFun(object = sm, nsim = nsim, seed = seed) : could not find function "sfun" I get the same error when I try to use the function simulate() on a negative binomial model. With other families I do not get an error. I found that Ben Bolker recommended a hack on the lme4 github site, but I cannot get it to work. https://github.com/lme4/lme4/issues/284 If fact, below is the code he suggested which gives me the above error. library(lme4) library(pbkrtest) set.seed(101) dd <- data.frame(f=factor(rep(1:10, each=50)), x=runif(500), y=rnbinom(500, size=2, mu=2)) g1 <- glmer.nb(y ~ x + (1|f), data=dd) g0 <- glmer.nb(y ~ 1 + (1|f), data=dd) PBmodcomp(g1, g0, nsim=10) Thanks! best, Lauren
Leithen M'Gonigle Assistant Professor Department of Biological Science Florida State University 319 Stadium Dr, Tallahassee, FL, 32306 Phone (office): +1 (850) 645-9532 Email: lmgonigle at bio.fsu.edu Web: http://www.bio.fsu.edu/~lmgonigle/ [[alternative HTML version deleted]]