GAMMs: difference smooths in itsadug
Hi Sebastian, are you using gamm4? If so, you can extract the GAM object, which if I'm not mistaken is already marginalized over the random effects i.e. is just fixed effects, and just use its plotting functions. model <- gamm4(....) plot(model$gam) Best, Phillip
On 16/07/18 09:20, Sebastian Sauppe wrote:
Dear list members, I have a question on the treatment of random effects in plotting difference smooths for GAMMs with the package itsadug. I am modelling the time course of binomial data with mgcv::bam. The simplified formula is: cbind(success, failure) ~ 1 + s(Time, by = Condition) + s(Subject, Time, bs = ?fs?) + s(Item, Time, bs = ?fs?). The two factor smooths are supposed to account for the random effects of participants and stimuli in my experiments. I would like to use itsadug::plot_diff() to visualize how the two conditions differ over time. However, I am not quite sure what the rm.ranef argument argument of this function does. What I basically want to do is to look at the difference the way one would look at a fixed effect in an GLMER model, i.e., looking at the fixed effect of the interaction of Time:Condition after the variance that can be ascribed to random effects of subjects and items have been accounted for. Would for this rm.ranef=TRUE or rm.ranef=FALSE be the right option? Kind regards, Sebastian ----------- Dr. Sebastian Sauppe Department of Comparative Linguistics, University of Zurich Homepage: https://sites.google.com/site/sauppes/ <https://sites.google.com/site/sauppes/> Twitter: @SebastianSauppe <https://twitter.com/SebastianSauppe> Google Scholar Citations: https://scholar.google.de/citations?user=wEtciKQAAAAJ <https://scholar.google.de/citations?user=wEtciKQAAAAJ> ResearchGate: http://www.researchgate.net/profile/Sebastian_Sauppe <http://www.researchgate.net/profile/Sebastian_Sauppe> ORCID ID: http://orcid.org/0000-0001-8670-8197 <http://orcid.org/0000-0001-8670-8197> [[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models