data("wafers")
#### GLM
wfit <- fitme(y ~ X1+X2+X1*X3+X2*X3+I(X2^2), family=Gamma(log), data=wafers)
drop1(wfit, test = "F")
drop1(wfit, test = "F", scope= ~ X1 + X1 * X3 ) # note the message!
#### LMM
if(requireNamespace("lmerTest", quietly=TRUE)) {
lmmfit <- fitme(y ~X1+X2+X1*X3+X2*X3+I(X2^2)+(1|batch),data=wafers)
drop1(lmmfit) # => Satterthwaite method here giving p-values quite close to
# traditional t-tests given by:
summary(lmmfit, details=list(p_value=TRUE))
}
#### GLMM
wfit <- fitme(y ~ X1+X2+X1*X3+X2*X3+I(X2^2)+(1|batch), family=Gamma(log),
rand.family=inverse.Gamma(log), resid.model = ~ X3+I(X3^2) , data=wafers)
drop1(wfit)
drop1(wfit, scope= ~ X1 + X1 * X3 ) # note the message!
Run the code above in your browser using DataLab