[R] extracting partial residuals of each level of an interaction in a Mixed GAM

From: Amparo Lazaro <amparo.lazaro_at_imedea.uib-csic.es>
Date: Fri, 25 Mar 2011 12:33:24 +0100

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,


R-help_at_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. Received on Fri 25 Mar 2011 - 13:08:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Mar 2011 - 13:20:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive