I am fitting a model in which the response variable y is a function of two independent, quantitative variables x1 and x2; thus: y = f(x1, x2). For reasons I do not believe to be important for the purpose of this post, I find it desirable to find f by means of GAM; also, I require principal effects and interactions to be specified separately, so I am using using te and ti tensors. Thus, I am using the following command:
f = gam(y ~ te(x1) + te(x2) + ti(x1, x2)) This results in a model that corresponds to one of the hypotheses I am testing. Nevertheless, another hypothesis requires that, when one of the independent variables (say x2) is zero, the value of y is unaffected by the other variable (in this example x1). In other words f(x1, 0) = k for every value of x1, where k is a constant to be estimated. For x2 values other than zero I would like to let GAM choose the appropriate function relating x1 and y. Is there a way to specify such model in mgcv? ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.