# NOT RUN {
data("wafers")
## Gamma GLMM with log link
m1 <- HLfit(y ~X1+X2+X1*X3+X2*X3+I(X2^2)+(1|batch),family=Gamma(log),
resid.model = ~ X3+I(X3^2) ,data=wafers,method="ML")
m2 <- update(m1,formula.= ~ . -I(X2^2))
anova(m1,m2)
# Using resp_testfn argument:
# }
# NOT RUN {
set.seed(1L)
d <- data.frame(success = rbinom(10, size = 1, prob = 0.9), x = 1:10)
xx <- cbind(1,d$x)
table(d$success)
m_x <- fitme(success ~ x, data = d, family = binomial())
m_0 <- fitme(success ~ 1, data = d, family = binomial())
anova(m_x, m_0, boot.repl = 100,
resp_testfn=function(y) {! is_separated(xx,as.numeric(y),verbose=FALSE)})
# }
# NOT RUN {
## Models differing both in fixed and random effects:
if (spaMM.getOption("example_maxtime")>11) {
set.seed(123)
dat <- data.frame(g = rep(1:10, e = 10), x = (x<-rnorm(100)),
y = 0.1 * x + rnorm(100))
m <- fitme(y ~ x + (1|g), data=dat)
m0 <- fitme(y ~ 1, data=dat)
(bootpval <- LRT(m,m0, boot.repl = 199L)$rawBootLRT$p_value)
## See help("get_RLRsim_args") for a fast and accurate test procedure
}
# }
Run the code above in your browser using DataLab