I am trying to fit a GAM regression to my data. However I have a question. So for instance if I have
Y = S(A) + S(B) as my GAM model,
Can I include a linear model of one variables, say B to the model. So that I get
Y = S(A) + B +S(B).
I do this because I want to obtain point estimates for the variable B. In that case how would this affect the interpretation of the smooth function. Can I say my smooth function S(B) shows the deviation from my average point estimates?
Specifically My question has to do with the interpretation of the above graph. Since I have included debtratiolagged also as a parametric term in the regression, would this affect the interpretation of the y-axis of the smooth function?
I don't have your data, so lets discuss with common data in a artificially 'simple' example.
I often produce my own datasets to test my understanding on concepts.
Here is an example.
I feel a bit out of my condifent zone here, but playing around, I think the following is rough but gives some insight. taking the previous code for granted.
What if we define a separate varaible z, to capture the higher order relationship of the poly x order 2.
If we fit the gam with x +s(z) where s(z) is some smoothed x^2 pure function with no linear term...
I can compare the plot(gam2) which is the y~x+s(x) with my hand plot of x by an approximate f(x,order 2) function) and I think its a close enough match.