Open mmcgillycuddy opened 1 month ago
drats... it seems that the nbinom2 family is not getting passed to the nodes when using multiple processors. You can beat this issue for the moment by using the argument ncpus=1
in your anovaPB
call.
Ok, thanks.
Meanwhile I came across another problem where I seem to get very different results if I run a bootstrap myself. For a LR = 545 and df =1 I would expect a small p-value but I get 0.941.
library(ecostats)
library(glmmTMB)
fm1 <- glmmTMB(count ~ mined + (1|spp), data = Salamanders, family=poisson())
fm0 <- update(fm1, ~ . - mined)
LRobs <- anova(fm1, fm0)[2, 6]
LRobs
LRstat <- rep(NA, 100)
for(i in 1:100){
simy <- simulate(fm0)[[1]]
ft_sim1 <- glmmTMB(simy~mined+(1|spp),
data=Salamanders,
family=poisson() )
ft_sim0 <- update(ft_sim1, ~ . - mined)
LRstat[i] <- anova(ft_sim1, ft_sim0)[2, 6]
}
(sum(LRstat >= LRobs, na.rm = T) + 1)/(100+1)
anovaPB(fm0, fm1, n.sim = 1000)
OK, the issue there is that you need to set colRef=6
, I'll change the default next update so that it does that
Oh nice! That's easy. Thanks David!
Hi David, I am getting some errors when using glmmTMB objects for anovaPB.