Hello everyone,
I am fitting two gamm4 models because I would like to see whether there is justification for including a spline term for x1. Can this be done by comparing the AICs for the underlying mixed models (i.e., the "mer" part) of the two models?
b1 <- gamm4(y~x1+offset(e),data=dat,random=~(1|fac))
b2 <- gamm4(y~x1+s(x1)+offset(e),data=dat,random=~(1|fac))
summary(b1$gam)
summary(b1$mer)
summary(b2$gam)
summary(b2$mer)
AIC(b1$mer)
AIC(b2$mer)
Thank you very much!
Best,
DaniNM
<http://aka.ms/weboutlook>