Re: [R] how to add in interaction terms in gamm

2011-03-23 Thread Simon Wood
The usual method for producing interactions of smooths with factors in mgcv is using `by' variables (see ?gam.models for some documentation). For example if `gender' is a two level factor then ... s(time,by=gender) + gender would produce a smooth of time for each gender. If you want a differen

[R] how to add in interaction terms in gamm

2011-03-23 Thread straybird_tx
I want to use gamm to generate smoothed trend line for three groups identified by dummy variable genea and geneb. My question is how to add in an interaction term between the time and another dummy variable such as gender? fitm<-gamm(change_gfr~ genea+geneb+s(timea_n,bs="ps")+s(timeb_n,bs="ps")+s