Skip to content
Prev 360829 / 398506 Next

physical constraint with gam

The spline having a positive value is not the same as a glm coefficient 
having a positive value. When you plot a smooth, say s(x), that is 
equivalent to plotting the line 'beta * x' in a GLM. It is not 
equivalent to plotting 'beta'. The smooths in a gam are (usually) 
subject to `sum-to-zero' identifiability constraints to avoid 
confounding via the intercept, so they are bound to be negative over 
some part of the covariate range. For example, if I have a model y ~ 
s(x) + s(z), I can't estimate the mean level for s(x) and the mean level 
for s(z) as they are completely confounded, and confounded with the 
model intercept term.

I suppose that if you want to interpret the smooths as glm parameters 
varying with the covariate they relate to then you can do, by setting 
the model up as a varying coefficient model, using the `by' argument to 
's'...

gam(snowdepth~s(fsca,by=fsca),data=dat)


this model is `snowdepth_i = f(fsca_i) * fsca_i + e_i' . s(fsca,by=fsca) 
is not confounded with the intercept, so no constraint is needed or 
applied, and you can now interpret the smooth like a local GLM coefficient.

best,
Simon
On 11/05/16 01:30, Dominik Schneider wrote: