I am wondering why you would want to use a by variable smooth
s(time, by= x)? (time is non-linear hence why I am using GAMs)
I am using GAMs to explore if my response $y$ changes over $x$ or some other categorical factor. Furthermore, if $y$ changes over on $x$, have these differences changed over time?
Also, if I have an interaction between $x$ and $z$, what would be the reasons for me including this interaction in the
by = argument over time as
s(time, by= interaction(x,z))?
How do you assess if you need to have different smooths/curves for an interaction?
Any help is appreciated, I am new to GAMs!