Hi,
I'm using the library mgcv to fit Mixed effect GAM (gamm). My model is simple but account for an interaction between a factor and a continuous covariate. This is an example of my model: mymodel<-gamm(visrate ~ factor(ExClutrEat)+s(logplantdiv,k=3, by=E)+s(logplantdiv,k=3, by=C) , random=list(plotID=~1), family=Gamma (link=log), data=bartsia)

I would like to extrat the partial residuals of each level of the interaction to plot them in different colors in the graph. I tried to extract them in the same way I do with a classic GAM (not including random factor), but then the extracted partial residuals do not fit with the points plotted by "plot(mymodel$gam, res=TRUE)" function in the "gamm" . I guess this is because the random effect is not being taking into account, but I don't know how to account for the random effect to extract the ´real´ partial residuals for of each level of the interaction in a gamm. Did anybody have this problem before? Any suggestions?

Thanks in advance,

Amparo

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to