I'm trying to build a model with an overall smooth function for all the data, plus an additional smooth function for *some* of the data. If "ind" is my indicator variable (0 for some x, 1 for others), I imagined I could write it like this:

gam.obj <- gam(y ~ s(x) + ind*s(x))

but this does not work.

Does mgcv have a way of doing this? If not directly, is there a reasonable workaround?

______________________________________________
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